aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-25 02:31:16 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-25 02:31:16 +1200
commitce2f2fd10e0938c2e613820402fa8db14fc2cb26 (patch)
tree984e0b6d0f418fbebe67e67c4b493dbeb51769dd
parentAdd filename pattern without period for viminfo (diff)
downloaddotfiles-ce2f2fd10e0938c2e613820402fa8db14fc2cb26.tar.gz
dotfiles-ce2f2fd10e0938c2e613820402fa8db14fc2cb26.zip
Use ternary logic for 'softtabstop' setting
-rw-r--r--vim/vimrc13
1 files changed, 6 insertions, 7 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 416eece3..7bbc1ab1 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -12,13 +12,12 @@ set autoindent " Use indent of previous line on new lines
set expandtab " Use spaces instead of tabs
set shiftwidth=4 " Indent with four spaces
-" Make a tab key in insert mode add the same number of spaces as 'shiftwidth'
-if v:version > 703 " Can use negative value as reference to &shiftwidth
- \ || v:version == 703 && has('patch693')
- set softtabstop=-1
-else
- let &softtabstop = &shiftwidth
-endif
+" Make insert mode tab key add the same number of spaces as 'shiftwidth', use
+" negative value to do this if Vim new enough to support it
+let &softtabstop =
+ \ v:version > 703 || v:version == 703 && has('patch693')
+ \ ? -1
+ \ : &shiftwidth
" Restore insert mode 'backspace' limits to the stringent Vim default, if a
" system vimrc or Neovim has messed with it