From dc24c30618aa6b1162c5759ee46611babaa03026 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 22 Jun 2018 21:12:33 +1200 Subject: 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'. --- vim/vimrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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= -- cgit v1.2.3