How to update git diff output in Vim

The command I use to test the diff of a project is

git diff | vimdiff -

Is there a way to update a diff file without an existing Vim and repeat the previous command?

+3
source share
2 answers

The Vim instance receives diff information from stdin(through the shell shell |), so there is no way to update this.

If you do not want to exit Vim and invoke a command from the shell history, I would recommend using a plugin (for example fugitive.vim - A Git wrapper is so large it should be illegal ) that allows you to run (and re-run!) Diff from the inside Vim.

+4
source

In Vim:

:%d | .!git diff

, git diff cwd .

+2

All Articles