X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/da848b61477f8fc21b93fe4952574d229c9b1b93..1b34e5bf23e5d5a68632e0d6ab0433472accde7d:/vim/ftplugin/cpp.vim?ds=inline diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index 542503a..23503b8 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -21,9 +21,25 @@ augroup fswitch au BufEnter *.cpp let b:fswitchlocs = 'reg:|source|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 +" format with = +map = (operator-clang-format) +vnoremap = :ClangFormat +" restore = mapping to g= +nnoremap g= = +vnoremap g= = + setlocal errorformat= setlocal errorformat+=%f:%l:%c:\ %trror:\ %m setlocal errorformat+=%f:%l:%c:\ %tarning:\ %m