11 setlocal cinkeys-=0# " don't reindent PP directives
12 setlocal cinoptions+=:0 " don't indent case labels
14 " Load the doxygen syntax
15 let b:load_doxygen_syntax = 1
17 let g:switch_custom_definitions =
19 \ ['EXPECT_FALSE', 'EXPECT_TRUE'],
20 \ ['EXPECT_EQ', 'EXPECT_NE'],
21 \ ['EXPECT_LT', 'EXPECT_GT'],
22 \ ['ASSERT_FALSE', 'ASSERT_TRUE'],
23 \ ['ASSERT_EQ', 'ASSERT_NE'],
24 \ ['ASSERT_LT', 'ASSERT_GT']
27 let g:switch_const_definitions =
29 \ '\%(const \)\@!\([[:alnum:]_:<>]\{-}\) \%(&\)\@!': 'const \1 ',
30 \ 'const \([[:alnum:]_:<>]\{-}\) &\@!': 'const \1 &' ,
31 \ 'const \([[:alnum:]_:<>]\{-}\) &': '\1 '
34 nnoremap <buffer> <leader>c :call switch#Switch(g:switch_const_definitions, {})<cr>
36 nnoremap <buffer> gd :YcmCompleter GoTo<CR>
37 nnoremap <buffer> <C-W>d :vs<CR>:YcmCompleter GoTo<CR>
40 map <buffer> = <Plug>(operator-clang-format)
41 vnoremap <buffer> = :ClangFormat<CR>
42 " restore = mapping to g=
47 setlocal errorformat+=%f:%l:%c:\ %trror:\ %m
48 setlocal errorformat+=%f:%l:%c:\ %tarning:\ %m
49 setlocal errorformat+=%D%*\\a[%*\\d]:\ Entering\ directory\ [`']%f'
50 setlocal errorformat+=%X%*\\a[%*\\d]:\ Leaving\ directory\ [`']%f'
51 setlocal errorformat+=%D%*\\a:\ Entering\ directory\ [`']%f'
52 setlocal errorformat+=%X%*\\a:\ Leaving\ directory\ [`']%f'
53 setlocal errorformat+=%*[^[]\[%tRROR\]%m\ \[%f:%l\]
54 setlocal errorformat+=%*[^[]\[%tARNING\]%m\ \[%f:%l\]
56 setlocal foldmethod=syntax
57 " set foldlevel according to number of matches of 'namespace' and 'class' not
59 function! InitialFoldLevel()
61 keepjumps keeppatterns silent! 1,/}/s/^\(namespace\|class\) \+[^;]*$//n
63 let &foldlevel=str2nr(split(v:statusmsg)[0])
66 call InitialFoldLevel()