coc.nvim support
This commit is contained in:
3
coc-settings.json
Normal file
3
coc-settings.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"explorer.icon.enableNerdfont": true
|
||||
}
|
||||
35
layers/plug/coc.vim
Normal file
35
layers/plug/coc.vim
Normal file
@ -0,0 +1,35 @@
|
||||
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 <silent><expr> <TAB> coc#pum#visible() ? coc#pum#next(1) : CheckBackspace() ? "\<Tab>" : coc#refresh()
|
||||
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||
# Use <c-space> to trigger completion
|
||||
inoremap <silent><expr> <c-@> coc#refresh()
|
||||
# Use K to show documentation in preview window
|
||||
nnoremap <silent> K :call ShowDocumentation()<CR>
|
||||
# Highlight the symbol and its references when holding the cursor
|
||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||
}
|
||||
})
|
||||
|
||||
@ -7,3 +7,5 @@ TuiLayer plug.nerdtree
|
||||
TuiLayer plug.poplar
|
||||
|
||||
TuiLayer plug.whichkey
|
||||
|
||||
TuiLayer plug.coc
|
||||
|
||||
@ -3,11 +3,12 @@ vim9script
|
||||
const g:which_key_map = {
|
||||
f: {
|
||||
name: 'File',
|
||||
o: ['Poplar', 'open']
|
||||
o: ['Poplar', 'open'],
|
||||
x: ['q', 'quit']
|
||||
},
|
||||
v: {
|
||||
name: 'View',
|
||||
f: [":NERDTreeToggle", "nerdtree"]
|
||||
f: ["NERDTreeToggle", "nerdtree"]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user