From b7b23001def8d2ae816ff6dd772cd50976189e0e Mon Sep 17 00:00:00 2001 From: David Elentok <3david@gmail.com> Date: Thu, 10 Sep 2015 22:20:18 +0300 Subject: [PATCH] Allow using the "%" variable in git commands Closes https://github.com/tpope/vim-fugitive/issues/686 For example, when running: :Git add % neovim throws the following exception: E499: Empty file name for '%' or '#', only works with ":p:h": terminal git add % It is a result of the tabnew command, it creates a new blank tab where "%" is empty. This commit changes "tabnew" to "tabedit %" so you're still working on the same file. Once the command is done running the tab closes. --- plugin/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 6a7cf4d..2fe01d9 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -683,7 +683,7 @@ function! s:Git(bang, args) abort let args = matchstr(a:args,'\v\C.{-}%($|\\@