gv.vim icon indicating copy to clipboard operation
gv.vim copied to clipboard

Export a Git diff command

Open da-x opened this issue 7 years ago • 4 comments

GV current shows various Git diffs (unlike vim-fugitive, whichonly shows database objects), so it makes sense to export this functionality, say, for viewing the diff against HEAD or the index.

For instance:

:call gv#diff("HEAD")

:call gv#diff("--cached", "HEAD")

da-x avatar Jun 18 '18 21:06 da-x

Doesn't fugitive already provide this? :Gdiff ... for the current file or :Git diff ... for the whole repo.

justinmk avatar Jun 19 '18 08:06 justinmk

Yes, the vimdiff-based Gdiff works with vim-fugitive, however sometimes I just want a quick glance at the unidiff-based format of the diff in a split window, which is what gv good at.

da-x avatar Jun 20 '18 07:06 da-x

Did you try :Git diff ... (not :Gdiff) ?

justinmk avatar Jun 20 '18 08:06 justinmk

Yes, however that halts Vim to spawn Git. I think the gv diff buffer in a split window has some benefits over it.

da-x avatar Jun 20 '18 08:06 da-x