diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-29 16:26:37 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-29 16:41:45 +1200 |
commit | a019f8e837d9e641a955f928ded00be4db149957 (patch) | |
tree | ea31567eeb05bfbdcd959f363b1ba0f566d85909 /vim/after/ftplugin | |
parent | Update strip_trailing_whitespace.vim plugin (diff) | |
download | dotfiles-a019f8e837d9e641a955f928ded00be4db149957.tar.gz dotfiles-a019f8e837d9e641a955f928ded00be4db149957.zip |
Set 'include' and 'path' specifically in C/C++
Otherwise, use defaults that should be meaningful in other languages
too, just to be tidy and not to show string.h in :find results when
editing Awk scripts.
Diffstat (limited to 'vim/after/ftplugin')
-rw-r--r-- | vim/after/ftplugin/c/include.vim | 22 | ||||
-rw-r--r-- | vim/after/ftplugin/cpp/include.vim | 22 |
2 files changed, 44 insertions, 0 deletions
diff --git a/vim/after/ftplugin/c/include.vim b/vim/after/ftplugin/c/include.vim new file mode 100644 index 00000000..ce78d495 --- /dev/null +++ b/vim/after/ftplugin/c/include.vim @@ -0,0 +1,22 @@ +" c/include.vim: Set 'include' and 'path' + +" Don't load if running compatible or too old +if &compatible || v:version < 700 + finish +endif + +" Don't load if already loaded +if exists('b:did_ftplugin_c_include') + finish +endif + +" Flag as loaded +let b:did_ftplugin_c_include = 1 +let b:undo_ftplugin = b:undo_ftplugin + \ . '|unlet b:did_ftplugin_c_include' + +" Use trailing whitespace to denote continued paragraph +setlocal include=^\\s*#\\s*include +setlocal path+=/usr/include +let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal include< path<' diff --git a/vim/after/ftplugin/cpp/include.vim b/vim/after/ftplugin/cpp/include.vim new file mode 100644 index 00000000..6c039287 --- /dev/null +++ b/vim/after/ftplugin/cpp/include.vim @@ -0,0 +1,22 @@ +" c/include.vim: Set 'include' and 'path' + +" Don't load if running compatible or too old +if &compatible || v:version < 700 + finish +endif + +" Don't load if already loaded +if exists('b:did_ftplugin_cpp_include') + finish +endif + +" Flag as loaded +let b:did_ftplugin_cpp_include = 1 +let b:undo_ftplugin = b:undo_ftplugin + \ . '|unlet b:did_ftplugin_cpp_include' + +" Use trailing whitespace to denote continued paragraph +setlocal include=^\\s*#\\s*include +setlocal path+=/usr/include +let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal include< path<' |