Skip to content

Commit d6f1d6e

Browse files
committed
more
1 parent 1f534d6 commit d6f1d6e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

coc.vim

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set updatetime=100
2+
" GoTo code navigation.
3+
nmap <silent> gd <Plug>(coc-definition)
4+
nmap <silent> gy <Plug>(coc-type-definition)
5+
nmap <silent> gi <Plug>(coc-implementation)
6+
nmap <silent> gr <Plug>(coc-references)
7+
8+
" Use K to show documentation in preview window.
9+
nnoremap <silent> K :call <SID>show_documentation()<CR>
10+
11+
function! s:show_documentation()
12+
if (index(['vim','help'], &filetype) >= 0)
13+
execute 'h '.expand('<cword>')
14+
else
15+
call CocActionAsync('doHover')
16+
endif
17+
endfunction
18+
19+
" Highlight the symbol and its references when holding the cursor.
20+
autocmd CursorHold * silent call CocActionAsync('highlight')

init.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Plug 'SirVer/ultisnips'
66
Plug 'honza/vim-snippets'
77
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
88
Plug 'junegunn/fzf.vim'
9-
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
9+
Plug 'neoclide/coc.nvim', {'branch': 'release'}
1010
Plug 'itchyny/lightline.vim'
1111
Plug 'mengelbrecht/lightline-bufferline'
1212
Plug 'lifepillar/vim-gruvbox8'
@@ -88,3 +88,5 @@ let g:lightline = {
8888
\ 'buffers': 'tabsel'
8989
\ }
9090
\}
91+
92+
source ~/.config/nvim/coc.vim

0 commit comments

Comments
 (0)