vim plugin of the month, diff chunks of files

This vim plugin can run vimdiff, on two versions of a function in different files, etc.


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 '' \
  > ~/.vim/autoload/pathogen.vim
echo 'call pathogen#infect()' >> ~/.vimrc
git clone git:// \

The ‘pathogen’ thing is not a virus, it’s a vim package manager, can make it easier to install and update plugins.

This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to vim plugin of the month, diff chunks of files

  1. Prudhvi Krishna Surapaneni says:

    Thanks for this Sam. I always wanted to see git diff’s i guess, i can use this in combination with git.

  2. sswam says:

    I wrote something better for that, which is here:
    There are also cvs-vimdiff and svn-vimdiff.
    I use these scripts almost every day, to see what I’ve changed.

  3. sswam says:

    Stackoverflow may have some better suggestions too, such as this:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s