coc.nvim support
This commit is contained in:
@ -1,19 +1,11 @@
|
|||||||
vim9script
|
vim9script
|
||||||
|
|
||||||
def CheckBackspace(): bool
|
export def CheckBackspace(): bool
|
||||||
let col = col('.') - 1
|
let col = col('.') - 1
|
||||||
return !col || getline('.')[col - 1] =~# '\s'
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def ShowDocumentation()
|
g:coc_global_extensions = ['coc-marketplace', 'coc-json', 'coc-vimlsp', 'coc-explorer', 'coc-git']
|
||||||
if CocAction('hasProvider', 'hover')
|
|
||||||
call CocActionAsync('doHover')
|
|
||||||
else
|
|
||||||
call feedkeys('K', 'in')
|
|
||||||
endif
|
|
||||||
enddef
|
|
||||||
|
|
||||||
final g:coc_global_extensions = ['coc-marketplace', 'coc-json', 'coc-vimlsp', 'coc-explorer', 'coc-git']
|
|
||||||
|
|
||||||
tui#core#plug#Regist('neoclide/coc.nvim', {
|
tui#core#plug#Regist('neoclide/coc.nvim', {
|
||||||
branch: 'release',
|
branch: 'release',
|
||||||
@ -27,7 +19,7 @@ tui#core#plug#Regist('neoclide/coc.nvim', {
|
|||||||
# Use <c-space> to trigger completion
|
# Use <c-space> to trigger completion
|
||||||
inoremap <silent><expr> <c-@> coc#refresh()
|
inoremap <silent><expr> <c-@> coc#refresh()
|
||||||
# Use K to show documentation in preview window
|
# Use K to show documentation in preview window
|
||||||
nnoremap <silent> K :call ShowDocumentation()<CR>
|
nnoremap <silent><expr> K coc#rpc#request('hasProvider', ['hover']) ? coc#rpc#notify('doHover', []) : feedkeys('K', 'in')
|
||||||
# Highlight the symbol and its references when holding the cursor
|
# Highlight the symbol and its references when holding the cursor
|
||||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user