From 60478a59b0923e628601655d724283635758b2d3 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 31 Jan 2022 13:44:26 +0530 Subject: [PATCH] nvim: after/plugin/fugitive: Make diff & difftool usage painless --- nvim/.config/nvim/after/plugin/fugitive.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/after/plugin/fugitive.vim b/nvim/.config/nvim/after/plugin/fugitive.vim index 9ff42a0..d60deb4 100644 --- a/nvim/.config/nvim/after/plugin/fugitive.vim +++ b/nvim/.config/nvim/after/plugin/fugitive.vim @@ -5,8 +5,8 @@ nnoremap gb :Git branch -a nnoremap gB :Git branch nnoremap gc :Git checkout -b nnoremap gC :Git checkout -nnoremap gd :Ghdiffsplit! -nnoremap gD :Gvdiffsplit! +nnoremap gd :Gdiff +nnoremap gD :Gdifftool nnoremap ge :sp:Gedit HEAD~:% nnoremap gE :sp:Gedit :%:p nnoremap gf :Git fetch --all --tags -f @@ -40,3 +40,6 @@ augroup custom_fugitive autocmd FileType fugitive,fugitiveblame nnoremap q :bwipeout! autocmd BufReadPost fugitive:// setlocal bufhidden=wipe augroup END + +command! Gdiff tabnew % | Gvdiffsplit! +command! Gdifftool tabedit +set\ buftype=nofile\ bufhidden=wipe | Git difftool