diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-16 23:13:34 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-16 23:13:34 +1200 |
commit | 6fbe041164f21a8f5ed1f9d43ade397f51bf7c7e (patch) | |
tree | 114e68ff8e4e4e48f1c90b215017589abe29afcd /vim/vimrc | |
parent | Dispense with system-dependent files (diff) | |
download | dotfiles-6fbe041164f21a8f5ed1f9d43ade397f51bf7c7e.tar.gz dotfiles-6fbe041164f21a8f5ed1f9d43ade397f51bf7c7e.zip |
Leverage negative 'softtabstop' value
From :help 'softtabstop':
> When 'sts' is negative, the value of 'shiftwidth' is used.
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -32,10 +32,19 @@ catch endtry " The all-important default indent settings; filetypes to tweak -set autoindent " Use indent of previous line on new lines -set expandtab " Use spaces instead of tabs -set shiftwidth=4 " Indent with four spaces -set softtabstop=4 " Insert four spaces with tab key +set autoindent " Use indent of previous line on new lines +set expandtab " Use spaces instead of tabs +set shiftwidth=4 " Indent with four spaces + +" The number of spaces the Tab key should insert should follow 'shiftwidth'; +" if Vim is new enough (v7.3.693), use a negative value to automate this, +" otherwise just use its present value +if v:version > 703 + \ || v:version == 703 && has('patch693') + set softtabstop=-1 +else + let &softtabstop = &shiftwidth +endif " Let me backspace over pretty much anything set backspace+=eol " Line breaks |