Update coc settings

master
Hektor Misplon 2021-08-31 14:23:13 +02:00
parent 92aeb5d195
commit cef617928a
1 changed files with 11 additions and 0 deletions

11
.vimrc
View File

@ -130,10 +130,21 @@ let g:coc_global_extensions = [
\'coc-snippets' \'coc-snippets'
\] \]
" Autocomplete " Autocomplete
imap <tab> <Plug>(coc-snippets-expand)
nn <leader>es :CocCommand snippets.editSnippets<cr>
ino <silent><expr><c-j> pumvisible() ? "\<c-n>" : ino <silent><expr><c-j> pumvisible() ? "\<c-n>" :
\ coc#refresh() \ coc#refresh()
ino <expr><c-k> pumvisible() ? "\<C-p>" : "k" ino <expr><c-k> pumvisible() ? "\<C-p>" : "k"
ino <expr><cr> complete_info()["selected"] != "-1" ? "\<c-y>" : "\<c-g>u\<CR>" ino <expr><cr> complete_info()["selected"] != "-1" ? "\<c-y>" : "\<c-g>u\<CR>"
" Show doccumentation
fu! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('')
else
call CocAction('doHover')
endif
endfunction
nnoremap K :call show_documentation()
" Code action on cursor position " Code action on cursor position
nm <leader>do <Plug>(coc-codeaction) nm <leader>do <Plug>(coc-codeaction)
" Coc statusline " Coc statusline