Git alias to open all diffs in vim tabs

5 June, 2012

This is a handy little alias I’ve been using recently to open all unstaged diffs in a single instance of vim, one tab per file. Add the following to the [alias] section of your ~/.gitconfig:

dt = "!f() { vim -p $(git diff --name-only) +\"tabdo Gdiff [email protected]\" +tabfirst; }; f"

Known issues:

Both of the above could be resolved by writing a little script to open all the diffs in vim rather than using fugitive’s :Gdiff command, but for now this little alias does the job nicely.

Tagged with: alias, git, vim