" Disable arrow keys noremap noremap noremap noremap inoremap inoremap inoremap inoremap " Disable manual and ex mode nnoremap nnoremap Q " Quick escape inoremap jk inoremap kj " Quick save nnoremap :w " Better tabbing vnoremap < >gv " Quick window switching " Ctrl-[hjkl] nnoremap h nnoremap j nnoremap k nnoremap l " Quick window resizing " Alt-[hjkl] nnoremap :resize -2 nnoremap :resize +2 nnoremap :vertical resize -2 nnoremap :vertical resize +2 " Quicker omni complete nav " Ctrl-[jk] inoremap ("\") inoremap ("\") " Distraction free typing " l - Toggle Goyo and Limelight nnoremap l :Goyo autocmd! User GoyoEnter Limelight autocmd! User GoyoLeave Limelight! " fzf " p - Search files in current workdir " P - Search files in $HOME " g - Search commits for current buffer " G - Search commits in current workdir " f - Search source in current workdir " ; - Search buffers nnoremap p :Files nnoremap P :Files ~ nnoremap g :BCommits nnoremap G :Commits nnoremap f :Rg nnoremap ; :Buffers " coc.nvim explorer " e - Toggle explorer on/off " E - Open current file location nmap e :CocCommand explorer nmap E :CocCommand explorer --reveal expand('') " coc.nvim " Ctrl-n - Go to previous diagnostic " Ctrl-p - Go to next diagnostic " d - Jump to definition of current symbol " r - Jump to references of current symbol " j - Jump to implementation of current symbol " s - Fuzzy search current project symbols " n - Symbol renaming nmap (coc-diagnostic-prev) nmap (coc-diagnostic-next) nmap d (coc-definition) nmap r (coc-references) nmap j (coc-implementation) nmap s :CocList -I -N --top symbols nmap n (coc-rename) " Search shorcuts " h - Find and replace " / - Clear highlighted search terms while preserving history nnoremap h :%s/// nnoremap / :nohlsearch " use for trigger completion and navigate to next complete item inoremap \ pumvisible() ? "\" : \ check_back_space() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\" function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~ '\s' endfunction " Use to trigger completion. if has('nvim') inoremap coc#refresh() else inoremap coc#refresh() endif " 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('') elseif (coc#rpc#ready()) call CocActionAsync('doHover') else execute '!' . &keywordprg . " " . expand('') endif endfunction " Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync('highlight') augroup mygroup autocmd! " Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end