"""" Leader shortcuts let mapleader = "," " also use space as leader nmap nmap w :w! command! W execute 'w !sudo tee % > /dev/null' edit! " nmap W :w! "Reload vimrc on config change map e :e! ~/.vimrc " FIXME: This results in some weird conflict with lightline autocmd! bufwritepost ~/.vimrc source ~/.vimrc autocmd! bufwritepost $DOTFILES/vim/* source ~/.vimrc " Quickly open a markdown buffer for scribble map x :e ~/buffer.md " Toggle paste mode on and off nmap pp :setlocal paste! " Re-select the text block just pasted nnoremap vv V`] " open quickfix nmap cc :botright cope " 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 wz :call WinZoomToggle() nmap \ :Explore nnoremap C :close nnoremap B :Bclose nnoremap k :Ack "" Fugitive nnoremap / :Git nnoremap g :Git nnoremap gd :Git diff nnoremap gp :Git push nnoremap M :Git commit nnoremap gpf :Git push --force-with-lease "" Gitutter nnoremap u :GitGutterBufferToggle nnoremap L :GitGutterLineHighlightsToggle nnoremap hn :GitGutterNextHunk nnoremap hp :GitGutterPrevHunk "" Ale nmap (ale_previous_wrap) nmap (ale_next_wrap) nmap sv :ALEGoToDefinition -vsplit nmap sh :ALEGoToDefinition -split nmap st :ALEGoToDefinition -tab nmap A :ALEGoToDefinition nmap n :ALEFindReferences nmap h :ALEHover nmap r :ALERename map ` :ALELint map nn :NERDTreeToggle map o :BufExplorer "" CtrlP " Quickly find and open a recently opened file " let g:ctrlp_map = '' map :CtrlPBuffer map j :CtrlP map b :CtrlPBuffer map f :CtrlPMRUFiles map t :CtrlPTag "" Indent Guides map I :IndentGuidesToggle " Goyo nmap za :Goyo 80%x85% nmap zz :Goyo ""Misc stuff let s:uname='' let s:uname = system('uname | tr -d "\n"') " Get platform name (stripping the trailing newline) if s:uname == "Darwin" "" Mac specific stuff elseif s:uname == "linux" "" Linux specific stuff " Wayland clipboard fix https://github.com/vim/vim/issues/5157 xnoremap "+y :call system("wl-copy", @") nnoremap "+p :let @"=substitute(system("wl-paste --no-newline"), '', '', 'g')p xnoremap "*y :call system("wl-copy --primary", @") nnoremap "*p :let @"=substitute(system("wl-paste --no-newline --primary"), '', '', 'g')p else "" Unkown platform endif " Add shortcuts to yank/paste to unnamed/unnamedplus clipboards noremap y "*y noremap p "*p noremap Y "+y noremap P "+p " A friggin python breakpoint. Invoke with @b "FIXME: make this decent let @b = 'A breakpoint()€ýajkj0' " visual mode mappings vnoremap k :call VisualSelection('ack', '') vnoremap gs :call GitShowVisual() vnoremap r :call VisualSelection('replace', '')