From 87aaa766199f7cc7661b4a119786117c06f912cb Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sat, 1 Apr 2017 18:35:38 +0100 Subject: [PATCH] vim: add constness switcher for cpp files --- vim/ftplugin/cpp.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index be1b64d..23503b8 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -21,6 +21,15 @@ 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 -- 2.48.1