" fugitive nnoremap gs :G20+ nnoremap gd :Gvdiff20+ nnoremap gc :Gcommit20+ nnoremap gw :Gwrite20+ nnoremap gb :Gblame20+ " fzf nnoremap , :Files nnoremap . :Buffers nnoremap l :Lines nnoremap a :Rg nnoremap h :History: " EasyMotion let g:EasyMotion_do_mapping=0 let g:EasyMotion_smartcase=1 nmap s (easymotion-overwin-f) nmap S (easymotion-overwin-f2) " COC.vim inoremap \ pumvisible() ? coc#_select_confirm() : \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : \ check_back_space() ? "\" : \ coc#refresh() function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction let g:coc_snippet_next = '' " Use to confirm completion, `u` means break undo chain at current " position. Coc only does snippet and additional edit on confirm. " could be remapped by other vim plugin, try `:verbose imap `. if exists('*complete_info') inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" else inoremap pumvisible() ? "\" : "\u\" endif " GoTo code navigation. nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window. nnoremap K :call show_documentation() function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') else call CocAction('doHover') endif endfunction " Leader mappings nmap c (coc-rename) nmap e (coc-diagnostic-next) xmap f (coc-format-selected) nmap f (coc-format-selected) " Selection ranges nmap (coc-range-select) xmap (coc-range-select) " Map function and class text objects " NOTE: Requires 'textDocument.documentSymbol' support from the language server. xmap if (coc-funcobj-i) omap if (coc-funcobj-i) xmap af (coc-funcobj-a) omap af (coc-funcobj-a) xmap ic (coc-classobj-i) omap ic (coc-classobj-i) xmap ac (coc-classobj-a) omap ac (coc-classobj-a) " Add `:Format` command to format current buffer. command! -nargs=0 Format :call CocAction('format') " coc-yank, replaces yankstack, use alt + p nnoremap π :CocList -A --normal yank " coc multiple cursors (very helpful for when in CocSearch) hi CocCursorRange ctermbg=139 ctermfg=234 nmap (coc-cursors-word)* xmap y/\V=escape(@",'/\')gN(coc-cursors-range)gn