X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/142642341841fb1d501db76a844d14178dca6da6..refs/heads/ultrahaptics:/vim/ftplugin/cpp.vim diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index 534eb78..82e3170 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -1,5 +1,3 @@ -setlocal foldmethod=syntax - setlocal textwidth=100 " indent 4 spaces @@ -13,7 +11,28 @@ setlocal autoindent setlocal cinkeys-=0# " don't reindent PP directives setlocal cinoptions+=:0 " don't indent case labels +" Load the doxygen syntax +let b:load_doxygen_syntax = 1 + augroup fswitch - au BufEnter *.h let b:fswitchdst = 'cpp,c' - au BufEnter *.h let b:fswitchlocs = 'reg:/include/source/' + au BufEnter *.h let b:fswitchdst = 'cpp,c' + au BufEnter *.h 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 gd :YcmCompleter GoTo +nnoremap d :vs:YcmCompleter GoTo + +setlocal foldmethod=syntax +setlocal foldlevel=99 +" set foldlevel according to number of matches of 'namespace' and 'class' not +" containing ';' +" function! InitialFoldLevel() +" let v:errmsg = "" +" keepjumps keeppatterns silent! 1,/}/s/^\(namespace\|class\) \+[^;]*$//n +" if v:errmsg == "" +" let &foldlevel=str2nr(split(v:statusmsg)[0]) +" endif +" endf +" call InitialFoldLevel()