aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-19 16:09:51 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-19 16:11:42 +1200
commitfa6ed737961d053ee22d78d0e1c9a5575d1af171 (patch)
tree782526a6c2398c78ee0f11fc12d7a06249a0e459
parentType proto/*.pro files as C (diff)
downloaddotfiles-fa6ed737961d053ee22d78d0e1c9a5575d1af171.tar.gz
dotfiles-fa6ed737961d053ee22d78d0e1c9a5575d1af171.zip
Set 'shiftwidth' to 4 for C Vim sources
-rw-r--r--vim/after/indent/c.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/vim/after/indent/c.vim b/vim/after/indent/c.vim
index 1893f564..87291541 100644
--- a/vim/after/indent/c.vim
+++ b/vim/after/indent/c.vim
@@ -4,3 +4,8 @@ if &softtabstop != -1
let &softtabstop = &shiftwidth
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/'
+ setlocal shiftwidth=4
+endif