]> git.rmz.io Git - dotfiles.git/blobdiff - vim/ftplugin/c.vim
systemd: 4min timeout for mbsync
[dotfiles.git] / vim / ftplugin / c.vim
index 16a9bf6c349cdec189a1c444ee81c0dc1c8b4ded..9dbf048aff37dad5de82537f0bbef982a396794f 100644 (file)
@@ -2,11 +2,19 @@
 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>
 nnoremap <buffer> <C-W>d :vs<CR>:YcmCompleter GoTo<CR>
+
+setlocal cinoptions=     " reset cinoptions
+setlocal cinoptions+=l1  " align with case label