Tuesday, April 24, 2012

Vim slick trick of the day...

I've always wanted to know how to do this and happened to stumbled across it in a forum.
Here's how you take the piped output from two commands and vimdiff them together.

vimdiff <(cat filename1) <(cat filename2)

Ridiculous, I know.  But the point is the commands can be anything allowed by the shell.

vimdiff <(grep foo filename1 | grep -v bar | sort -u) <(grep foo filename2 | grep -v bar | sort -u)

No comments:

Post a Comment