This vim plugin can run vimdiff, on two versions of a function in different files, etc.
http://www.vim.org/scripts/script.php?script_id=3745
Usage:
1. visual select some function in one file
2. :’<,’>Linediff
3. select the other version of function in other (or same) file
4. :’<,’>Linediff
It will open a new tab with vimdiff on those two sections, then after you close the tab it puts the sections back in the original files.
Recommended install goes like this:
mkdir -p ~/.vim/autoload ~/.vim/bundle curl 'www.vim.org/scripts/download_script.php?src_id=16224' \ > ~/.vim/autoload/pathogen.vim echo 'call pathogen#infect()' >> ~/.vimrc git clone git://github.com/AndrewRadev/linediff.vim.git \ ~/.vim/bundle/linediff
The ‘pathogen’ thing is not a virus, it’s a vim package manager, can make it easier to install and update plugins.
Thanks for this Sam. I always wanted to see git diff’s i guess, i can use this in combination with git.
I wrote something better for that, which is here:
http://sam.nipl.net/code/nipl-tools/bin/git-vimdiff
There are also cvs-vimdiff and svn-vimdiff.
I use these scripts almost every day, to see what I’ve changed.
Stackoverflow may have some better suggestions too, such as this:
http://stackoverflow.com/questions/3713765/viewing-all-git-diffs-with-vimdiff