From e7f272a36c52b63ac1889d9d658fecefb2d555b2 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 6 Jul 2019 07:39:05 -0400 Subject: [PATCH] Change :Git! to split by default --- autoload/fugitive.vim | 2 +- doc/fugitive.txt | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index d321cfa..758b582 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1960,7 +1960,7 @@ function! s:GitCommand(line1, line2, range, count, bang, mods, reg, arg, args) a let tree = s:Tree(dir) let [args, after] = s:SplitExpandChain(a:arg, tree) if a:bang - return s:OpenExec('edit', a:mods, args, dir) . after + return s:OpenExec((a:count > 0 ? a:count : '') . (a:count ? 'split' : 'edit'), a:mods, args, dir) . after endif let git = s:UserCommand(dir) if has('gui_running') && !has('win32') diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 8bb9fc7..1c85eb6 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -21,7 +21,8 @@ that are part of Git repositories). *fugitive-:Git!* :Git! [args] Like |:Git|, but capture the output into a temp file, - and edit that temp file. + and |:split| that that temp file. Use :0Git to + |:edit| the temp file instead. *fugitive-:Gcd* :Gcd [directory] |:cd| relative to the repository. @@ -106,8 +107,10 @@ that are part of Git repositories). :Gsplit! [args] *fugitive-:Gsplit!* *fugitive-:Gvsplit!* :Gvsplit! [args] *fugitive-:Gtabedit!* *fugitive-:Gpedit!* -:Gtabedit! [args] Like |:Git!|, but open the resulting temp file in a -:Gpedit! [args] split, tab, or preview window. +:Gtabedit! [args] Capture the output of `git [args]` to a temp file and +:Gpedit! [args] open it in a split, tab, or preview window. Use + :0Gsplit! to suppress the split and open it in the + current window. *fugitive-:Gread* :Gread [object] Empty the buffer and |:read| a |fugitive-object|.