"""" 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 map ` :ALELint " FIXME: This results in some weird conflict with lightline autocmd! bufwritepost ~/.vimrc source ~/.vimrc " Quickly open a markdown buffer for scribble map x :e ~/buffer.md " Toggle paste mode on and off nmap pp :setlocal paste! " 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 map :noh "disable highlighting for current word map ss :setlocal spell! nnoremap mk :bel copensilent (cargo run) !redraw! 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 nmap hn (GitGutterNextHunk) nmap 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 " call ack when pressing gv in visual vnoremap gv :call VisualSelection('gv', '') 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 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'