From 24e705b332e2010ae03d50a8fd4d87973190de7a Mon Sep 17 00:00:00 2001 From: bretello Date: Mon, 7 Feb 2022 21:08:04 +0100 Subject: [PATCH] vim: shortcuts improvements - add `T` when on python file to run the pytest test under the cursor - add xx to open a work buffer - cleanup fugitive diff/blame/log maps - remove outdated maps --- vim/shortcuts.vim | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/vim/shortcuts.vim b/vim/shortcuts.vim index 0ab1a91..84bf245 100644 --- a/vim/shortcuts.vim +++ b/vim/shortcuts.vim @@ -20,6 +20,7 @@ autocmd! bufwritepost $DOTFILES/vim/plugs.vim PlugInstall " 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! @@ -61,10 +62,10 @@ nnoremap k :Rg "" Fugitive nnoremap / :Git nnoremap \ :0Git -nnoremap Gd :Gvdiffsplit -nnoremap Gb :Git blame +nnoremap d :Gvdiffsplit +nnoremap b :Git blame nnoremap Gp :Git push -nnoremap Gl :vert Git log +nnoremap l :vert Git log % nnoremap Gc :Git commit nnoremap Gpf :Git push --force-with-lease @@ -103,8 +104,9 @@ map J :Files map f :History map T :BTags map t :Tags -map l :Lines -map c :CtrlPQuickfix +" map l :Lines +" FIXME: Not using CtrlP anymore, replace this with fzf +""map c :CtrlPQuickfix map s :Snippets map ; :Commands map m :Maps @@ -157,6 +159,7 @@ 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