aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/c.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/after/ftplugin/c.vim')
-rw-r--r--vim/after/ftplugin/c.vim16
1 files changed, 10 insertions, 6 deletions
diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim
index b5989410..d67e3654 100644
--- a/vim/after/ftplugin/c.vim
+++ b/vim/after/ftplugin/c.vim
@@ -1,14 +1,18 @@
-" Set 'commentstring' and 'include' back to their default C-friendly values
-setlocal commentstring&vim
-setlocal include&vim
+" Set 'commentstring', 'define', and 'include' back to their default
+" C-friendly values
+setlocal commentstring&vim define&vim include&vim
+let b:undo_ftplugin .= '|setlocal commentstring< define< include<'
" Include macros in completion
setlocal complete+=d
+let b:undo_ftplugin .= '|setlocal complete<'
+
+" Fold based on indent level
+setlocal foldmethod=indent
+let b:undo_ftplugin .= '|setlocal foldmethod<'
" Include system headers on UNIX
if has('unix')
setlocal path+=/usr/include
+ let b:undo_ftplugin .= '|setlocal path<'
endif
-
-" Undo all of the above
-let b:undo_ftplugin .= '|setlocal commentstring< complete< include< path<'