aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-25 02:24:24 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-25 02:24:46 +1300
commit9bb807878c64ffde8da20aab0d817423f3531435 (patch)
treee924a8c9ee3861fda6cc314e8281fd5d953e9874
parentUndo shell script dialect flags from filetype.vim (diff)
downloaddotfiles-9bb807878c64ffde8da20aab0d817423f3531435.tar.gz
dotfiles-9bb807878c64ffde8da20aab0d817423f3531435.zip
Set missing b:undo_indent instructions for AWK
Switching filetypes from "awk" to another type doesn't load the indentation of the new type, due to the absence of this setting.
-rw-r--r--vim/after/indent/awk.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/vim/after/indent/awk.vim b/vim/after/indent/awk.vim
new file mode 100644
index 00000000..fc848d2a
--- /dev/null
+++ b/vim/after/indent/awk.vim
@@ -0,0 +1,7 @@
+" The stock AWK indenting is decent, but doesn't include an undo variable;
+" this adds one, clearing away the sole global function too.
+if !exists('b:undo_indent')
+ let b:undo_indent = 'unlet! b:did_indent'
+ let b:undo_indent = b:undo_indent . '|setlocal indentexpr< indentkeys<'
+ let b:undo_indent = b:undo_indent . '|delfunction! GetAwkIndent'
+endif