vim9script def CheckBackspace(): bool let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' enddef def ShowDocumentation() 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', { branch: 'release', config: () => { set updatetime=300 set signcolumn=yes inoremap coc#pum#visible() ? coc#pum#next(1) : CheckBackspace() ? "\" : coc#refresh() inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" inoremap coc#pum#visible() ? coc#pum#confirm() : "\u\\=coc#on_enter()\" # Use to trigger completion inoremap coc#refresh() # Use K to show documentation in preview window nnoremap K :call ShowDocumentation() # Highlight the symbol and its references when holding the cursor autocmd CursorHold * silent call CocActionAsync('highlight') } })