From bbd9afe7905d300375115f08df1a530bebe3af96 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 15 Aug 2019 03:38:09 -0400 Subject: [PATCH] Provide map to close diff buffers --- autoload/fugitive.vim | 1 + doc/fugitive.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 43e8490..b484ce1 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -5422,6 +5422,7 @@ function! fugitive#MapJumps(...) abort call s:MapMotion('][', 'exe NextSectionEnd(v:count1)') endif call s:Map('n', 'S', ':echoerr "Use gO"', '') + call s:Map('n', 'dq', ":call DiffClose()", '') call s:Map('n', '-', ":exe 'Gedit ' . fnameescape(NavigateUp(v:count1)) if getline(1) =~# '^tree \x\{40,\}$' && empty(getline(2))call search('^'.escape(expand('#:t'),'.*[]~\').'/\=$','wc')endif", '') call s:Map('n', 'P', ":exe 'Gedit ' . fnameescape(ContainingCommit().'^'.v:count1.Relative(':'))", '') call s:Map('n', '~', ":exe 'Gedit ' . fnameescape(ContainingCommit().'~'.v:count1.Relative(':'))", '') diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 059dabb..76c0dcd 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -308,6 +308,9 @@ dv Perform a |:Gvdiffsplit| on the file under the cursor. *fugitive_ds* *fugitive_dh* ds Perform a |:Ghdiffsplit| on the file under the cursor. dh + *fugitive_dq* +dq Close all but one diff buffer, and |:diffoff|! the + last one. *fugitive_d?* d? Show this help.