Updated neovim config

This commit is contained in:
Jef Roosens 2021-04-22 00:33:26 +02:00
parent ed8e52b480
commit 2d36cb3c69
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
3 changed files with 26 additions and 8 deletions

View file

@ -1,3 +1,4 @@
" Default config
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
@ -18,14 +19,20 @@ inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Select first option if no option is selected on enter
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>"
" Project refactoring keybinding
nnoremap <silent> <leader>pwr :CocSearch <C-R>=expand("<cword>")<CR><CR>
" Own config
" Project refactoring keybinding
nmap <silent> <leader>pwr :CocSearch <C-R>=expand("<cword>")<CR><CR>
" Go to definition
nmap gd <Plug>(coc-definition)
" Return from jump (e.g. go to definition)
nmap gb <C-o>
" Go to implementation
nmap gi <Plug>(coc-implementation)
" Show references of word
nmap gr <Plug>(coc-references)
" Refactor
nmap <leader>rf <Plug>(coc-refactor)
" Jump between diagnostic positions
nmap <silent> <leader>dk <Plug>(coc-diagnostic-prev)
@ -33,6 +40,8 @@ nmap <silent> <leader>dK <Plug>(coc-diagnostic-prev-error)
nmap <silent> <leader>dj <Plug>(coc-diagnostic-next)
nmap <silent> <leader>dJ <Plug>(coc-diagnostic-next-error)
" Code formatting
" vnoremap <silent>
" Show full diagnostics list
nmap <silent> <leader>dd :CocDiagnostics<CR>