]> git.rmz.io Git - dotfiles.git/commitdiff
vim: consolidate fswitch settings in c.vim
authorSamir Benmendil <samir.benmendil@ultrahaptics.com>
Tue, 24 Oct 2017 09:03:57 +0000 (10:03 +0100)
committerSamir Benmendil <samir.benmendil@ultrahaptics.com>
Tue, 24 Oct 2017 09:03:57 +0000 (10:03 +0100)
vim/ftplugin/c.vim
vim/ftplugin/cpp.vim

index 16a9bf6c349cdec189a1c444ee81c0dc1c8b4ded..a4625ac29a1cb2e989c65594a327dc1c010620c1 100644 (file)
@@ -2,10 +2,15 @@
 let b:load_doxygen_syntax = 1
 
 augroup fswitch
 let b:load_doxygen_syntax = 1
 
 augroup fswitch
-    au BufEnter *.h let b:fswitchdst  = 'c'
-    au BufEnter *.h let b:fswitchlocs = 'reg:|include.*|source|'
+    au!
+    au BufEnter *.h   let b:fswitchdst  = 'c,cpp'
+    au BufEnter *.h   let b:fswitchlocs = '.,reg:|include.*|src|'
     au BufEnter *.c let b:fswitchdst  = 'h'
     au BufEnter *.c let b:fswitchlocs = 'reg:|source|include/**|'
     au BufEnter *.c let b:fswitchdst  = 'h'
     au BufEnter *.c let b:fswitchlocs = 'reg:|source|include/**|'
+    au BufEnter *.hpp let b:fswitchdst  = 'cpp,c'
+    au BufEnter *.hpp let b:fswitchlocs = 'reg:|include.*|src|'
+    au BufEnter *.cpp let b:fswitchdst  = 'hpp,h'
+    au BufEnter *.cpp let b:fswitchlocs = 'reg:|src|include/**|'
 augroup END
 
 nnoremap <buffer> gd :YcmCompleter GoTo<CR>
 augroup END
 
 nnoremap <buffer> gd :YcmCompleter GoTo<CR>
index fabf6b9a541a3679b753d3dd34b8e3cd1954b39d..4d54b7bb5a88ddee17bbbc6650d3613fa2a9eb55 100644 (file)
@@ -14,13 +14,6 @@ setlocal cinoptions+=:0  " don't indent case labels
 " Load the doxygen syntax
 let b:load_doxygen_syntax = 1
 
 " Load the doxygen syntax
 let b:load_doxygen_syntax = 1
 
-augroup fswitch
-    au BufEnter *.hpp let b:fswitchdst  = 'cpp,c'
-    au BufEnter *.hpp let b:fswitchlocs = 'reg:|include.*|src|'
-    au BufEnter *.cpp let b:fswitchdst  = 'hpp,h'
-    au BufEnter *.cpp let b:fswitchlocs = 'reg:|src|include/**|'
-augroup END
-
 let g:switch_const_definitions =
     \ [ {
     \   '\%(const \)\@!\([[:alnum:]_:<>]\{-}\) \%(&\)\@!': 'const \1 ',
 let g:switch_const_definitions =
     \ [ {
     \   '\%(const \)\@!\([[:alnum:]_:<>]\{-}\) \%(&\)\@!': 'const \1 ',