gitvimdiffgit-diff

How to refresh git diff output in Vim


The command I use to check the project diff is

git diff | vimdiff -

Is there a way I can refresh the diff file without existing Vim and repeating the previous command?


Solution

  • The Vim instance only receives the diff information from stdin (via the | shell pipe), so there's no way to refresh that.

    If you don't want to exit Vim and recall the command from the shell history, I would recommend using a plugin (like fugitive.vim - A Git wrapper so awesome, it should be illegal) that allows you to trigger (and re-trigger!) a diff from within Vim.