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>
+
nnoremap <buffer> gd :YcmCompleter GoTo<CR>
nnoremap <buffer> <C-W>d :vs<CR>:YcmCompleter GoTo<CR>
+" format with =
+map <buffer> = <Plug>(operator-clang-format)
+vnoremap <buffer> = :ClangFormat<CR>
+" restore = mapping to g=
+nnoremap <buffer>g= =
+vnoremap <buffer>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 ';'