"""" Leader shortcuts let mapleader = ',' " also use space as leader map nmap w :w! command! W execute 'w !sudo tee % > /dev/null' edit! " nmap W :w! "Reload vimrc on config change map e :e! ~/.vimrc map ef :e! $DOTFILES/vim/functions.vim map ec :e! $DOTFILES/vim/plugins_config.vim map es :e! $DOTFILES/vim/shortcuts.vim map ep :e! $DOTFILES/vim/plugs.vim " Quickly open a markdown buffer for scribble map x :e ~/buffer.md map xx :e ~/projects/work/buffer.md " Toggle paste mode on and off nmap pp :setlocal paste! " Re-select the text block just pasted nnoremap vv V`] " Easy tab navigation with T nmap Tn :tabnext nmap TN :tabnew nmap Tp :tabprev nmap Tc :tabclose nmap n :tabnext nmap p :tabprev nmap N :tabnew " move betweween functions/methods/classes definition, " [m moves to the start of the previous method, ]m to the start of the next " zz centers the result map ] ]mzz map [ [mzz " open quickfix nmap cc :botright cope " open loclist nmap ll :botright lope " close quickfix (also see C below) nmap cx :hide nmap co ggVGy:tabnew:set syntax=qfpgg " next cope error map N :cnext " previous cope error map P :cprevious "disable highlighting for current word map :noh map S :setlocal spell! nnoremap M :bel copensilent make redraw! nnoremap wz :call WinZoomToggle() nnoremap q :close nnoremap B :Bclose nnoremap Q :close! nnoremap k :Rg "" Fugitive nnoremap / :vert Git nnoremap \ :0Git nnoremap d :Gvdiffsplit nnoremap b :Git blame nnoremap gp :Git push nnoremap gl :Commits nnoremap gL :BCommits nnoremap gc :Git commit nnoremap gpf :Git push --force-with-lease "" Gitutter nnoremap u :GitGutterBufferToggle nnoremap L :GitGutterLineHighlightsToggle nnoremap gp :GitGutterPrevHunk nnoremap gn :GitGutterNextHunk nnoremap gs :GitGutterStageHunk nnoremap gu :GitGutterUndoHunk "" Coverage Highlight nnoremap H :HighlightCoverageForAll " Ale nmap (ale_previous_wrap) nmap (ale_next_wrap) nmap R :ALERepeatSelection nmap sv :ALEGoToDefinition -vsplit nmap sh :ALEGoToDefinition -split nmap st :ALEGoToDefinition -tab nmap A :ALEGoToDefinition nmap n :ALEFindReferences -quickfix copen nmap h :ALEHover nmap r :ALERename nmap ` :ALELint nmap F :ALEFix nmap D :ALEToggle map nn :NERDTreeToggle "" fzf.vim " Quickly find and open a recently opened file map o :Buffers map j :GFiles map J :Files map f :History map T :BTags map t :Tags map l :Lines " FIXME: Not using CtrlP anymore, replace this with fzf ""map c :CtrlPQuickfix map s :Snippets map ; :Commands map m :Maps "" Indent Guides map I :IndentGuidesToggle map i :set cursorcolumn! "" Goyo nmap zz :Goyo """ Tagbar nmap :TagbarToggle ""Misc stuff if g:uname ==? 'Darwin' "" Mac specific stuff elseif g:uname ==? 'Linux' "" Linux specific stuff xnoremap "+y y:call system("wl-copy", @") map "+p :let @"=substitute(system('wl-paste --no-newline'), '', '', 'g') \| exec 'normal! ' . v:count1 . 'p' else "" Unknown platform endif " Add shortcuts to yank/paste to unnamed/unnamedplus clipboards map y "+y map p "+p map yp yankstack_substitute_older_paste map yn yankstack_substitute_newer_paste " Insert a python breakpoint let @b = 'obreakpoint(€kr€ýa0j' " visual mode mappings vnoremap k :call VisualSelection('LAck', '') vnoremap gs :call GitShowVisual() vnoremap r :call VisualSelection('replace', '') nnoremap K :exe "Rg " . expand("") nnoremap GL :exe "Git log -L:" . expand("") . ":" . expand("%") autocmd FileType python nnoremap T :Pytest function --pdb " Ultisnips map ue :UltiSnipsEdit nmap :Gradle assembleDebug nmap :AndroidInstall debug nmap :AndroidLaunch debug