X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/b95409a110b36eee9c2b30fefe04d1767758617f..refs/heads/cadscan:/vim/ftplugin/cpp.vim diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index 5f68c35..23503b8 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -16,14 +16,40 @@ 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:fswitchlocs = 'reg:|include.*|source|' au BufEnter *.cpp let b:fswitchdst = 'h' - au BufEnter *.cpp let b:fswitchlocs = 'reg:/\Csource/include/' + 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 +setlocal errorformat+=%D%*\\a[%*\\d]:\ Entering\ directory\ [`']%f' +setlocal errorformat+=%X%*\\a[%*\\d]:\ Leaving\ directory\ [`']%f' +setlocal errorformat+=%D%*\\a:\ Entering\ directory\ [`']%f' +setlocal errorformat+=%X%*\\a:\ Leaving\ directory\ [`']%f' +setlocal errorformat+=%*[^[]\[%tRROR\]%m\ \[%f:%l\] +setlocal errorformat+=%*[^[]\[%tARNING\]%m\ \[%f:%l\] + setlocal foldmethod=syntax " set foldlevel according to number of matches of 'namespace' and 'class' not " containing ';'