path: root/vim
diff options
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 /vim
parentRevise Vim 'shiftround' comment (diff)
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'.
Diffstat (limited to 'vim')
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
+ set softtabstop=4
" Let me backspace over pretty much anything
set backspace=