aboutsummaryrefslogtreecommitdiff
path: root/vim/indent
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-30 15:21:01 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-30 15:21:01 +1300
commit12107dc60a9c369a7b79e56c5d717d719dd633b8 (patch)
tree0c2f1b04e089ae8112a2f77533cbaf196059c050 /vim/indent
parentf33111bba5987aced0a50f14affe178e3834322f (diff)
downloaddotfiles-12107dc60a9c369a7b79e56c5d717d719dd633b8.tar.gz
dotfiles-12107dc60a9c369a7b79e56c5d717d719dd633b8.zip
Use version guard around numeric indent resets
My old 6.2 version of Vim tolerates neither `option<` nor `option=` syntax for resetting local versions of these options, so I'm just going to have to guard against running those commands on ancient Vim for now. They seem to work correctly on 7.0. :setlocal shiftwidth< Number required after =: shiftwidth< :setlocal shiftwidth= Number required after =: shiftwidth= :setlocal shiftwidth=0 Argument must be positive: shiftwidth=0
Diffstat (limited to 'vim/indent')
-rw-r--r--vim/indent/_GLOBAL.vim11
1 files changed, 8 insertions, 3 deletions
diff --git a/vim/indent/_GLOBAL.vim b/vim/indent/_GLOBAL.vim
index 3dad1a28..8280b9f8 100644
--- a/vim/indent/_GLOBAL.vim
+++ b/vim/indent/_GLOBAL.vim
@@ -3,6 +3,11 @@
" by a prior filetype (e.g. VimL).
setlocal autoindent<
setlocal expandtab<
-setlocal shiftwidth=
-setlocal softtabstop=
-setlocal tabstop=
+
+" Unfortunately, older versions of Vim (6.2 is known) accept neither the
+" `option<` nor `option=` syntax for resetting these numeric values.
+if v:version >= 700
+ setlocal shiftwidth=
+ setlocal softtabstop=
+ setlocal tabstop=
+endif