]> git.rmz.io Git - dotfiles.git/blobdiff - vim/ftplugin/c.vim
vim: suppor fswitching to/from cxx files
[dotfiles.git] / vim / ftplugin / c.vim
index 16a9bf6c349cdec189a1c444ee81c0dc1c8b4ded..a003e8ff43097d11b4c9db97918b343e780be0d4 100644 (file)
@@ -2,10 +2,15 @@
 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 BufEnter *.c let b:fswitchdst  = 'h'
-    au BufEnter *.c let b:fswitchlocs = 'reg:|source|include/**|'
+    au!
+    au BufEnter *.h        let b:fswitchdst  = 'c,cpp,cxx'
+    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 *.hpp      let b:fswitchdst  = 'cpp,cxx,c'
+    au BufEnter *.hpp      let b:fswitchlocs = 'reg:|include.*|src|'
+    au BufEnter *.c(pp|xx) let b:fswitchdst  = 'hpp,h'
+    au BufEnter *.c(pp|xx) let b:fswitchlocs = 'reg:|src|include/**|'
 augroup END
 
 nnoremap <buffer> gd :YcmCompleter GoTo<CR>