Martin Pool's blog

Insert a file as an email quotation in vim

In vim, to insert a file and turn it into an email quotation:

:r filename
:'[,']s/^/>

(The [ and ] markers are set to the region changed by the previous command, which is the entire inserted block.)

Archives 2008: Apr Feb 2007: Jul May Feb Jan 2006: Dec Nov Oct Sep Aug Jul Jun Jan 2005: Sep Aug Jul Jun May Apr Mar Feb Jan 2004: Dec Nov Oct Sep Aug Jul Jun May Apr Mar Feb Jan 2003: Dec Nov Oct Sep Aug Jul Jun May