From 3ea6f27772ef1eec6219b2141455112a398e129d Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 10 Dec 2021 00:22:49 +0800 Subject: Add keymap to YouCompleteMe --- .vim/plugin/youcompleteme.vim | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to '.vim') diff --git a/.vim/plugin/youcompleteme.vim b/.vim/plugin/youcompleteme.vim index d702738..67eac03 100644 --- a/.vim/plugin/youcompleteme.vim +++ b/.vim/plugin/youcompleteme.vim @@ -5,10 +5,29 @@ let g:ycm_collect_identifiers_from_comments_and_strings = 1 let g:ycm_complete_in_strings = 1 let g:ycm_filetype_whilelist = { - \ "c": 1, "cpp": 1, "sh": 1, "zsh": 1, - \ "python": 1, "go": 1, "gdscript": 1, + \ "c": 1, + \ "cpp": 1, + \ "go": 1, + \ "gdscript": 1, \ "lua": 1 + \ "python": 1, + \ "sh": 1, + \ "vim": 1, + \ "zsh": 1, \ } + let g:ycm_filetype_blacklist = { - \ 'ledger': 1, 'markdown': 1, 'org': 1 + \ 'ledger': 1, + \ 'markdown': 1, + \ 'org': 1 \ } + +nnoremap gd :YcmCompleter GoTo +nnoremap gr :YcmCompleter GoToReferences +nnoremap gi :YcmCompleter GoToImplementation +nnoremap gt :YcmCompleter GoToType +nmap gs (YCMFindSymbolInDocument) +nmap gS (YCMFindSymbolInWorkspace) +nmap K (YCMHover) + +autocmd! BufWritePre *.rs,*.go call execute('YcmCompleter Format') -- cgit v1.2.3