system/nix/progs/nvim/coc.vim

40 lines
1.1 KiB
VimL
Raw Normal View History

2022-06-23 10:45:58 +03:00
" Smaller updatetime for CursorHold & CursorHoldI
set updatetime=300
" don't give |ins-completion-menu| messages.
set shortmess+=c
" always show signcolumns
set signcolumn=yes
" Some server have issues with backup files, see coc#649
set nobackup
set nowritebackup
" Better display for messages
set cmdheight=2
" Use <c-space> for trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> for confirm completion, `<C-g>u` means break undo chain at current
" position. Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
2022-06-23 23:03:31 +03:00
" Use `[c` and `]c` for navigate diagnostics
nmap <silent> [c <Plug>(coc-diagnostic-prev)
nmap <silent> ]c <Plug>(coc-diagnostic-next)
2022-06-23 10:45:58 +03:00
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gt <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Remap for do code action of current line
2022-06-23 23:03:31 +03:00
nmap <localleader>a <Plug>(coc-codeaction)
2022-06-23 10:45:58 +03:00
" Remap for rename current word
2022-06-23 23:03:31 +03:00
nmap <localleader>n <Plug>(coc-rename)
2022-06-23 10:45:58 +03:00