aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-29 23:41:00 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-29 23:41:00 +1300
commitb202810bb1fa50905a5d7840d5fd4b00e34dbd8f (patch)
tree624265df948fb052314145977ab132d5257057e7
parent381b85d5067f496d65faa9fab54752299f61ad98 (diff)
downloaddotfiles-b202810bb1fa50905a5d7840d5fd4b00e34dbd8f.tar.gz
Pare down after/indent scripts a fair bit
More overzealous undo-setting. I should wait until it becomes an actual issue.
-rw-r--r--vim/after/indent/awk.vim7
-rw-r--r--vim/after/indent/html.vim3
-rw-r--r--vim/after/indent/perl.vim9
-rw-r--r--vim/after/indent/vim.vim20
4 files changed, 5 insertions, 34 deletions
diff --git a/vim/after/indent/awk.vim b/vim/after/indent/awk.vim
deleted file mode 100644
index fc848d2a..00000000
--- a/vim/after/indent/awk.vim
+++ /dev/null
@@ -1,7 +0,0 @@
-" 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
diff --git a/vim/after/indent/html.vim b/vim/after/indent/html.vim
index 6eae00ac..df74b174 100644
--- a/vim/after/indent/html.vim
+++ b/vim/after/indent/html.vim
@@ -1,4 +1,3 @@
" Don't re-indent lines on right-angle-bracket or enter
-setlocal indentkeys-=<>>
-setlocal indentkeys-=<Return>
+setlocal indentkeys-=<>>,<Return>
let b:undo_ftplugin .= '|setlocal indentkeys<'
diff --git a/vim/after/indent/perl.vim b/vim/after/indent/perl.vim
deleted file mode 100644
index 6f97d979..00000000
--- a/vim/after/indent/perl.vim
+++ /dev/null
@@ -1,9 +0,0 @@
-" The stock Perl indenting is decent, but doesn't include an undo variable;
-" this adds one
-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 . '|unlet! b:indent_use_syntax'
- let b:undo_indent = b:undo_indent . '|unlet! b:match_skip'
- let b:undo_indent = b:undo_indent . '|unlet! b:match_words'
-endif
diff --git a/vim/after/indent/vim.vim b/vim/after/indent/vim.vim
index 7e36c4cc..548d3e5c 100644
--- a/vim/after/indent/vim.vim
+++ b/vim/after/indent/vim.vim
@@ -1,20 +1,8 @@
" Observe VimL conventions for two-space indents
setlocal shiftwidth=2
-if v:version > 703 || v:version == 703 && has('patch693')
- setlocal softtabstop=-1
-else
- setlocal softtabstop=2
-endif
+setlocal softtabstop=2
+let b:undo_indent .= '|setlocal shiftwidth< softtabstop<'
" Remove inapplicable defaults from 'indentkeys'
-setlocal indentkeys-=0#
-setlocal indentkeys-=0{
-setlocal indentkeys-=0}
-setlocal indentkeys-=0)
-setlocal indentkeys-=:
-
-" Commands to undo the above
-if exists('b:undo_indent')
- let b:undo_indent = b:undo_indent . '|setlocal shiftwidth<'
- let b:undo_indent = b:undo_indent . '|setlocal softtabstop<'
-endif
+setlocal indentkeys-=0#,0{,0},0),:
+let b:undo_indent .= '|setlocal indentkeys<'