"""" 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 " 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 cn :cn " previous cope error map cp :cp "disable highlighting for current word map :noh map ss :setlocal spell! nnoremap M :bel copensilent make redraw! nnoremap wz :call WinZoomToggle() nnoremap q :close nnoremap B :Bclose nnoremap k :Rg "" Fugitive nnoremap / :Git nnoremap \ :0Git nnoremap d :Gvdiffsplit nnoremap b :Git blame nnoremap Gp :Git push nnoremap l :vert Git log % nnoremap Gc :Git commit nnoremap Gpf :Git push --force-with-lease "" Gitutter nnoremap u :GitGutterBufferToggle nnoremap L :GitGutterLineHighlightsToggle nnoremap gp :GitGutterPrevHunk nnoremap gn :GitGutterNextHunk "" 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 -relative nmap h :ALEHover nmap r :ALERename nmap ` :ALELint nmap F :ALEFix 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 za :Goyo 80%x85% nmap zz :Goyo ""Misc stuff if g:uname == "Darwin" "" Mac specific stuff elseif g:uname == "Linux" "" Linux specific stuff function! s:WaylandYank() if v:event['regname'] == '+' || (v:event['regname'] == 'w' && s:plus_to_w) call system('wl-copy', getreg(v:event['regname'])) endif endfunction " run s:WaylandYank() after every time text is yanked augroup waylandyank autocmd! autocmd TextYankPost * call s:WaylandYank() augroup END map "+p :let @"=substitute(system('wl-paste --no-newline'), '', '', 'g') \| exec 'normal! ' . v:count1 . 'p' 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 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("") autocmd FileType python nnoremap T :Pytest function --pdb " Ultisnips map ue :UltiSnipsEdit