X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/58d46aa2146196e37a219175ae5710588d2bb6b2..d2faeda2d1e616a2e2a2d2fbf1e45743a6b09c25:/vim/ftplugin/cpp.vim?ds=sidebyside diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index be1b64d..fabf6b9 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -15,12 +15,21 @@ setlocal cinoptions+=:0 " don't indent case labels 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 *.cpp let b:fswitchdst = 'h' - au BufEnter *.cpp 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 +let g:switch_const_definitions = + \ [ { + \ '\%(const \)\@!\([[:alnum:]_:<>]\{-}\) \%(&\)\@!': 'const \1 ', + \ 'const \([[:alnum:]_:<>]\{-}\) &\@!': 'const \1 &' , + \ 'const \([[:alnum:]_:<>]\{-}\) &': '\1 ' + \ } ] + +nnoremap c :call switch#Switch(g:switch_const_definitions, {}) + nnoremap gd :YcmCompleter GoTo nnoremap d :vs:YcmCompleter GoTo