@@ -12,23 +12,25 @@ let g:coc_global_extensions = [
12
12
\ ' coc-yank' ,
13
13
\]
14
14
15
- " Highlight symbol under cursor on CursorHold
16
- autocmd CursorHold * silent call CocActionAsync (' highlight' )
15
+ if exists (' g:did_coc_loaded' )
16
+ " Highlight symbol under cursor on CursorHold
17
+ autocmd CursorHold * silent call CocActionAsync (' highlight' )
17
18
18
- " Use K to show documentation in preview window.
19
- nnoremap <silent> K :call <SID> show_documentation()<CR>
19
+ " Use K to show documentation in preview window.
20
+ nnoremap <silent> K :call <SID> show_documentation()<CR>
20
21
21
- function ! s: show_documentation ()
22
- if (index ([' vim' ,' help' ], &filetype ) >= 0 )
23
- execute ' h ' .expand (' <cword>' )
24
- elseif (coc#rpc#ready ())
25
- call CocActionAsync (' doHover' )
26
- else
27
- execute ' !' . &keywordprg . " " . expand (' <cword>' )
28
- endif
29
- endfunction
22
+ function ! s: show_documentation ()
23
+ if (index ([' vim' ,' help' ], &filetype ) >= 0 )
24
+ execute ' h ' .expand (' <cword>' )
25
+ elseif (coc#rpc#ready ())
26
+ call CocActionAsync (' doHover' )
27
+ else
28
+ execute ' !' . &keywordprg . " " . expand (' <cword>' )
29
+ endif
30
+ endfunction
30
31
31
- " Use `:Format` for format current buffer
32
- command ! -nargs =0 Format :call CocAction (' format' )
33
- " Use `:Fold` for fold current buffer
34
- command ! -nargs =? Fold :call CocAction (' fold' , <f-args> )
32
+ " Use `:Format` for format current buffer
33
+ command ! -nargs =0 Format :call CocAction (' format' )
34
+ " Use `:Fold` for fold current buffer
35
+ command ! -nargs =? Fold :call CocAction (' fold' , <f-args> )
36
+ endif
0 commit comments