sponsor Vim development Vim logo Vim Book Ad

gitvimdiff : Script to show git diffs in vimdiff format

 script karma  Rating 47/23, Downloaded by 2852  Comments, bugs, improvements  Vim wiki

created by
Geoff Buchan
 
script type
utility
 
description
This script will show a git diff in vimdiff format. -g will use gvimdiff instead of vimdiff.

It creates a temporary file based on the diff output of git diff, and then runs vimdiff (or gvimdiff) against that. On completion it should delete the temporary files.
 
install details
The file itself is a bash script, so just make it executable on a Unix-like system.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
gitvimdiff 1.8 2022-05-26 7.0 Geoff Buchan Replace tempfile with mktemp to generate temporary file names. tempfile is deprecated and no longer distributed with the current Fedora, whereas mktemp exists both there and the older Debian installs I use.
gitvimdiff 1.7 2014-08-30 7.0 Geoff Buchan Use sed instead of cut to strip a filename out of a line of git status output. Cut was blindly removing 15 columns before, but the git status format changed slightly. sed now simply requires that the line start with '\\tmodified:'.
gitvimdiff 1.6 2013-04-07 7.0 Geoff Buchan Fix switch arguments to tempfile, and change temporary file name
to use full filename, not just the last token of it.
Thanks to Stefan Heinemann for pointing out the change to tempfile!
gitvimdiff 1.5 2009-08-27 7.0 Geoff Buchan Bug fix: remove temporary file with file suffix on exit
gitvimdiff 1.3 2009-08-26 7.0 Geoff Buchan Add code to put orignal file suffix on patched file.
This fixes syntax highlighting for the file.
Thanks to Stefan Heinemann for the patch!
gitvimdiff 1.2 2007-08-11 7.0 Geoff Buchan Initial upload
ip used for rating: 34.204.52.16

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github