aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-22 21:12:33 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-22 21:12:33 +1200
commitdc24c30618aa6b1162c5759ee46611babaa03026 (patch)
tree79014880611d18f7bf4cacdc0bac9d19d08bf10c
parentRevise Vim 'shiftround' comment (diff)
downloaddotfiles-dc24c30618aa6b1162c5759ee46611babaa03026.tar.gz
dotfiles-dc24c30618aa6b1162c5759ee46611babaa03026.zip
Use negative Vim 'softtabstop' value
From :help 'softtabstop': > When 'sts' is negative, the value of 'shiftwidth' is used. From :help version7.txt: > Patch 7.3.693 > Problem: Can't make 'softtabstop' follow 'shiftwidth'. > Solution: When 'softtabstop' is negative use the value of 'shiftwidth'.
-rw-r--r--vim/vimrc9
1 files changed, 8 insertions, 1 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 1037caf6..fb18a2bd 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -33,7 +33,14 @@ set autoindent " Use indent of previous line on new lines
set expandtab " Use spaces instead of tabs
set shiftround " Round indenting to multiples of 'shiftwidth'
set shiftwidth=4 " Indent with four spaces
-set softtabstop=4 " Insert four spaces for a Tab press
+
+" Spaces to insert on Tab key press; if supported, use negative value to
+" mirror 'shiftwidth'
+if v:version > 703 || v:version == 703 && has('patch693')
+ set softtabstop=-1
+else
+ set softtabstop=4
+endif
" Let me backspace over pretty much anything
set backspace=