From: Samir Benmendil Date: Tue, 2 May 2023 10:18:38 +0000 (+0100) Subject: vim/cpp: set ycm bindings in c.vim only, cpp loads that file too X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/ec103556f2e0a25af006b0e3096cf00f10d24793?ds=sidebyside vim/cpp: set ycm bindings in c.vim only, cpp loads that file too --- diff --git a/vim/ftplugin/c.vim b/vim/ftplugin/c.vim index dc06376..0dca3bc 100644 --- a/vim/ftplugin/c.vim +++ b/vim/ftplugin/c.vim @@ -17,6 +17,7 @@ nnoremap d :vs:YcmCompleter GoTo nnoremap gD :YcmCompleter GoToReferences nnoremap fi :YcmCompleter FixIt +nnoremap fr :YcmCompleter RefactorRename " format with = call operator#user#define_ex_command('ycmcompleter-format', 'YcmCompleter Format') diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index 12c6443..ea6837f 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -45,30 +45,6 @@ let g:switch_const_definitions = nnoremap c :call switch#Switch({'definitions': g:switch_const_definitions}) -" Disable ale as we use ycm -let b:ale_enabled = 0 - -nnoremap gd :YcmCompleter GoTo -nnoremap d :vs:YcmCompleter GoTo -nnoremap gD :YcmCompleter GoToReferences - -nnoremap fi :YcmCompleter FixIt -nnoremap fr :YcmCompleter RefactorRename - -" format with = -call operator#user#define_ex_command('ycmcompleter-format', 'YcmCompleter Format') -map = (operator-ycmcompleter-format) -vnoremap = :YcmCompleter Format -" restore = mapping to g= -nnoremap g= = -vnoremap g= = - -" hover popup -let g:ycm_auto_hover = '' -let b:ycm_hover = { 'command': 'GetDoc', 'syntax': &filetype } -nmap gh (YCMHover) -nmap gH :YcmCompleter GetDoc - setlocal errorformat= " TODO I don't remember these errorformat or what they match, maybe CMake? {{{ setlocal errorformat+=\ %##%n\ %m\ %f:%l:%c