Thursday, June 2, 2011

Get colors from Terminal, and pasting into vim from other programs

In seeking an answer to copying terminal output with ANSI-style colors, thanks goes to this question. I wanted to get colored output from Mac OS X's Terminal, and the easiest way was to print to a pdf and copy from there.

Also, here's the right way to paste into vim from an external source (such as a gist) because I seem to forget this (since I'm usually pasting from vim into vim). To avoid vim's auto-indenting or auto-commenting as the lines are written from the pastebuffer into vim, to enter paste mode just
:set paste
and then, back in insert mode, Ctrl+v or Command+v or whatever suits your fancy. Once you're done,
:set nopaste
You've now sidestepped all that pesky smart indentation/commenting.

No comments:

Post a Comment