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.

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.

Advertisements
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:
    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.

  3. sswam says:

    Stackoverflow may have some better suggestions too, such as this:
    http://stackoverflow.com/questions/3713765/viewing-all-git-diffs-with-vimdiff

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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