-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/**|'
-augroup END
+let g:switch_const_definitions =
+ \ [ {
+ \ '\%(const \)\@!\([[:alnum:]_:<>]\{-}\) \%(&\)\@!': 'const \1 ',
+ \ 'const \([[:alnum:]_:<>]\{-}\) &\@!': 'const \1 &' ,
+ \ 'const \([[:alnum:]_:<>]\{-}\) &': '\1 '
+ \ } ]
+
+nnoremap <buffer> <leader>c :call switch#Switch(g:switch_const_definitions, {})<cr>