" coc.nvim nmap fi (coc-fix-current) nmap gd (coc-definition) nmap gt (coc-type-definition) nmap sd (coc-diagnostic-info) nmap gr (coc-references) nmap K :call do#show_documentation() nmap (coc-diagnostic-next) nmap (coc-diagnostic-prev) if has('nvim') " Make nvim :terminal more like vim :terminal tnoremap N endif " termdebug " TODO: Detecet if termdebug is loaded, if not do the default action. nnoremap :Gdb nnoremap :Program nnoremap :Source tnoremap :Gdb tnoremap :Program tnoremap :Source " Quickfix list nnoremap qo :copen nnoremap qc :cclose nnoremap qq :cc nnoremap qn :cnext nnoremap qp :cprevious nnoremap qf :cfirst nnoremap qa :clast " Location list nnoremap lo :lopen nnoremap lc :lclose nnoremap ll :ll nnoremap ln :lnext nnoremap lp :lprevious nnoremap lf :lfirst nnoremap la :llast " Preview window nnoremap pc :pclose nnoremap pe :pedit nnoremap ps :psearch " fzf nnoremap f :Files nnoremap a :Ag nnoremap g :GitFiles nnoremap b :Buffers nnoremap l :BLines nnoremap c :Colors nnoremap h :Helptags nnoremap s :Snippets " Search to the word under the cursor nnoremap ag :Ag =expand('') " Treat long lines as line containing breaks nnoremap j gj nnoremap k gk " Quick write nnoremap w :w! " Switch panes in a tmux aware way if !has('win32') nnoremap :TmuxNavigateLeft nnoremap :TmuxNavigateDown nnoremap :TmuxNavigateUp nnoremap :TmuxNavigateRight nnoremap h :TmuxNavigateLeft nnoremap j :TmuxNavigateDown nnoremap k :TmuxNavigateUp nnoremap l :TmuxNavigateRight if has('nvim') tnoremap h :TmuxNavigateLeft tnoremap j :TmuxNavigateDown tnoremap k :TmuxNavigateUp tnoremap l :TmuxNavigateRight else tnoremap h N:TmuxNavigateLeft tnoremap j N:TmuxNavigateDown tnoremap k N:TmuxNavigateUp tnoremap l N:TmuxNavigateRight endif else nnoremap h nnoremap j nnoremap k nnoremap l endif " Quick tabs nnoremap tn :tabnew nnoremap tc :tabclose nnoremap to :tabonly nnoremap tm :tabmove " Clear search highlights nnoremap :nohlsearch if tmux#isOption('set-clipboard', 'on') || $SSH_CONNECTION !=# '' " When connected to a remote session the + selection register is not " available and the unnamed register is used instead. Add mappings using the " z register instead. noremap y "zy noremap Y "zY " Enable OSC 52 copy on yank. call osc52#autocmd() else " System clipboard yank/put noremap y "+y noremap Y "+Y noremap p "+p noremap P "+P endif if has('nvim') " Undo neovim's default mapping of Y to y$ unmap Y endif " Quickly access spelling menu inoremap us nnoremap ius " Disable 'Q' from opening Ex mode nnoremap Q " Split line at the cursor nnoremap [j i nnoremap ]j a " Toggle Checkbox nnoremap :ToggleCheckbox " Show highlight groups under the cursor nnoremap hi :CursorHighlightGroups " Rename C/C++ include guard nnoremap rg :call do#rename_include_guard(expand(''))