aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2021-12-10 00:22:49 +0800
committerGuangxiong Lin <[email protected]>2021-12-10 00:22:49 +0800
commit3ea6f27772ef1eec6219b2141455112a398e129d (patch)
tree44e01a866b91e2600e0453f27dee1bc01080e30c
parent6460922a0185d69d1d04899c922cb231d69af266 (diff)
downloaddotfiles-3ea6f27772ef1eec6219b2141455112a398e129d.tar.gz
dotfiles-3ea6f27772ef1eec6219b2141455112a398e129d.tar.bz2
dotfiles-3ea6f27772ef1eec6219b2141455112a398e129d.zip
Add keymap to YouCompleteMe
-rw-r--r--.vim/plugin/youcompleteme.vim25
1 files changed, 22 insertions, 3 deletions
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<CR>
+nnoremap gr :YcmCompleter GoToReferences<CR>
+nnoremap gi :YcmCompleter GoToImplementation<CR>
+nnoremap gt :YcmCompleter GoToType<CR>
+nmap gs <plug>(YCMFindSymbolInDocument)
+nmap gS <plug>(YCMFindSymbolInWorkspace)
+nmap K <plug>(YCMHover)
+
+autocmd! BufWritePre *.rs,*.go call execute('YcmCompleter Format')