From 6f787f8f6f5357e293fe5d0f7b0bdf8d0c73184d Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sun, 27 Mar 2022 09:22:24 +0800 Subject: Update the config of ycm (vim) --- .vim/after/plugin/youcompleteme.vim | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .vim/after/plugin/youcompleteme.vim (limited to '.vim/after/plugin') diff --git a/.vim/after/plugin/youcompleteme.vim b/.vim/after/plugin/youcompleteme.vim new file mode 100644 index 0000000..e673a65 --- /dev/null +++ b/.vim/after/plugin/youcompleteme.vim @@ -0,0 +1,41 @@ +let g:ycm_server_log_level = 'info' +let g:ycm_add_preview_to_completeopt = 'popup' +let g:ycm_collect_identifiers_from_comments_and_strings = 1 +let g:ycm_complete_in_strings = 1 +let g:ycm_auto_hover = 0 +let g:ycm_auto_trigger = 1 + +let g:ycm_show_diagnostics_ui = 0 +let g:ycm_error_symbol = 'E>' +let g:ycm_warning_symbol = 'W>' +autocmd BufNewFile,BufRead *.go let g:ycm_show_diagnostics_ui = 1 + +let g:ycm_filetype_whilelist = { + \ "c": 1, + \ "cpp": 1, + \ "go": 1, + \ "gdscript": 1, + \ "lua": 1, + \ "python": 1, + \ "sh": 1, + \ "vim": 1, + \ "zsh": 1 + \ } + +let g:ycm_filetype_blacklist = { + \ 'tagbar': 1, + \ 'leaderf': 1, + \ 'ledger': 1, + \ 'markdown': 1, + \ 'org': 1, + \ 'vimwiki': 1, + \ } + +nnoremap gd :YcmCompleter GoTo +nnoremap gr :YcmCompleter GoToReferences +nnoremap gi :YcmCompleter GoToImplementation +nmap fs (YCMFindSymbolInDocument) +nmap fS (YCMFindSymbolInWorkspace) +nmap K (YCMHover) + +autocmd BufWritePre *.rs,*.go call execute('YcmCompleter Format') -- cgit v1.2.3