Skip to main content
Post Made Community Wiki
Source Link

Another useful ZSH trick:

Treat the output of a command as a file:

emacs =(hg cat -r 100 somefile) 

This opens an old version of a Mercurial-tracked file in emacs for syntax-highlighted viewing. Without that, I would have to mess around with hg revert, hg archive, or explicitly send hg cat output to a temporary file.

Of course, this works with any program that opens files, and any program that prints to standard output.