aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-22 00:39:05 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-22 00:39:05 +1200
commitffdd2a9ab97397437a0a15c1433484ef4ea8cfe2 (patch)
tree136cbb80c407a8649b849178d72191183543f164 /vim
parentbd0f6a19426fe934f6c90d4a73fa657774d2cc1f (diff)
downloaddotfiles-ffdd2a9ab97397437a0a15c1433484ef4ea8cfe2.tar.gz
dotfiles-ffdd2a9ab97397437a0a15c1433484ef4ea8cfe2.zip
Clean up Vim indent settings a bit
Diffstat (limited to 'vim')
-rw-r--r--vim/after/indent/c.vim6
-rw-r--r--vim/after/indent/gitconfig.vim9
-rw-r--r--vim/indent/csv.vim9
-rw-r--r--vim/indent/help.vim6
4 files changed, 20 insertions, 10 deletions
diff --git a/vim/after/indent/c.vim b/vim/after/indent/c.vim
index dfc50242..ad01aceb 100644
--- a/vim/after/indent/c.vim
+++ b/vim/after/indent/c.vim
@@ -1,9 +1,11 @@
" Use hard tabs for C
-setlocal noexpandtab shiftwidth=0 tabstop=8
+setlocal noexpandtab
+setlocal shiftwidth=0
+let b:undo_indent .= '|setlocal expandtab< shiftwidth<'
if &softtabstop != -1
let &softtabstop = &shiftwidth
+ let b:undo_indent .= '|setlocal softtabstop<'
endif
-let b:undo_indent .= '|setlocal expandtab< shiftwidth< softtabstop< tabstop<'
" If the path to the file looks like the Vim sources, set 'shiftwidth' to 4
if expand('%:p') =~# '/vim.*src/'
diff --git a/vim/after/indent/gitconfig.vim b/vim/after/indent/gitconfig.vim
index 16a948ab..ff1654e5 100644
--- a/vim/after/indent/gitconfig.vim
+++ b/vim/after/indent/gitconfig.vim
@@ -1,6 +1,9 @@
" Use tabs for indent in Git config files, rather than fighting with the
" frontend tool
setlocal noexpandtab
-setlocal softtabstop=0
-let &shiftwidth = &tabstop
-let b:undo_indent .= '|setlocal expandtab< softtabstop< shiftwidth<'
+setlocal shiftwidth=0
+let b:undo_indent .= '|setlocal expandtab< shiftwidth<'
+if &softtabstop != -1
+ let &softtabstop = &shiftwidth
+ let b:undo_indent .= '|setlocal softtabstop<'
+endif
diff --git a/vim/indent/csv.vim b/vim/indent/csv.vim
index 78bddd33..a9aba056 100644
--- a/vim/indent/csv.vim
+++ b/vim/indent/csv.vim
@@ -10,6 +10,9 @@ let b:undo_indent = 'setlocal autoindent<'
" Literal tabs
setlocal noexpandtab
-setlocal softtabstop=0
-let &shiftwidth = &tabstop
-let b:undo_indent = 'setlocal expandtab< softtabstop< shiftwidth<'
+setlocal shiftwidth=0
+let b:undo_indent = 'setlocal expandtab< shiftwidth<'
+if &softtabstop != -1
+ let &l:softtabstop = &l:shiftwidth
+ let b:undo_indent .= '|setlocal softtabstop<'
+endif
diff --git a/vim/indent/help.vim b/vim/indent/help.vim
index 1edf64fb..c49e1ced 100644
--- a/vim/indent/help.vim
+++ b/vim/indent/help.vim
@@ -5,8 +5,10 @@ endif
let b:did_indent = 1
" Use hard tabs for editing Vim help files
-setlocal noexpandtab shiftwidth=0 tabstop=8
+setlocal noexpandtab
+setlocal shiftwidth=0
+let b:undo_indent = 'setlocal expandtab< shiftwidth<'
if &softtabstop != -1
let &softtabstop = &shiftwidth
+ let b:undo_indent = 'setlocal softtabstop<'
endif
-let b:undo_indent = 'setlocal expandtab< shiftwidth< softtabstop< tabstop<'