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/after | |
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/after')
-rw-r--r-- | vim/after/indent/vim.vim | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vim/after/indent/vim.vim b/vim/after/indent/vim.vim index 6e2eb7f3..0767bca0 100644 --- a/vim/after/indent/vim.vim +++ b/vim/after/indent/vim.vim @@ -1,5 +1,5 @@ -" Remove inapplicable defaults from 'indentkeys' -" Should only need to undo this if the stock plugin didn't +" Remove inapplicable defaults from 'indentkeys'; we should only need to undo +" this if the stock plugin didn't already arrange that (before v7.3.539) setlocal indentkeys-=0#,0{,0},0),: if !exists('b:undo_indent') let b:undo_indent = 'setlocal indentkeys<' @@ -7,5 +7,8 @@ endif " Observe VimL conventions for two-space indents setlocal shiftwidth=2 -setlocal softtabstop=2 -let b:undo_indent .= '|setlocal shiftwidth< softtabstop<' +let b:undo_indent .= '|setlocal shiftwidth<' +if &softtabstop != -1 + let &l:softtabstop = &l:shiftwidth + let b:undo_indent .= '|setlocal softtabstop<' +endif |