diff options
author | Alex Auvolat <alex@adnab.me> | 2023-12-07 10:00:56 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-12-07 10:00:56 +0100 |
commit | a14793d00a0c9ead72e9f991ab658a3d4b2901e1 (patch) | |
tree | 0d53d11871a2cea8438923f94d3c1f4507260a4a /vim/vimrc | |
parent | dd74b0d39d881745fcf37a309ea407fccadc7314 (diff) | |
download | user-config-a14793d00a0c9ead72e9f991ab658a3d4b2901e1.tar.gz user-config-a14793d00a0c9ead72e9f991ab658a3d4b2901e1.zip |
vim: add coc key bindings
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -10,16 +10,32 @@ map <leader>T <Esc>:set expandtab ts=4 sw=4 sts=4<CR> " Folds: " map <leader>f <Esc>:set fen fdn=3 fdm=indent fml=1 fdc=3<CR> -map ; <ESC>:FZF<CR> +" ; -> FZF (see :help fzf-vim-commands) +map ; <ESC>:GFiles<CR> " H-L for next-prev buffer nnoremap <leader>l :bnext<CR> nnoremap <leader>k :bprev<CR> -" S-D for prev/next Coc diagnostic +" S-D for prev/next Coc error diagnostic +" X-C for prev/next Coc diagnostic nnoremap <leader>d <Plug>(coc-diagnostic-next-error) nnoremap <leader>s <Plug>(coc-diagnostic-prev-error) +nnoremap <leader>x <Plug>(coc-diagnostic-next) +nnoremap <leader>c <Plug>(coc-diagnostic-prev) + +" F for Coc show documentation +nnoremap <leader>f :call ShowDocumentation()<CR> +function! ShowDocumentation() + if CocAction('hasProvider', 'hover') + call CocActionAsync('doHover') + else + call feedkeys('K', 'in') + endif +endfunction +" Symbol renaming +nmap <leader>rn <Plug>(coc-rename) " Append modeline after last line in buffer. " Use substitute() instead of printf() to handle '%%s' modeline in LaTeX |