[TAG] Simple 2-pence tip: Vim :paste / :nopaste

Thomas Adam thomas at edulinux.homeunix.org
Thu Feb 9 00:50:39 MSK 2006


This one is so simple, it's probably always overlooked by many -- or some
other alternative solutions are used.  There are times (such as viewing a
webpage), when one performs "cut-and-paste" from that page, into an
editor.  I use Vim running in an rxvt.  Sometimes (depending on the CR at
the ends of the line, there'll be a "stair-case" effect.  In the past, I
would do (in normal mode):

ggVG=

to reformat (and reindent) the text, but even that's not always the full
solution.  The "preferred" way is to do this:

:set paste

before you paste the text into vim.  Then when you're done, issue:

:set nopaste

... and carry on as normal.  It's great.  :)

-- Thomas Adam

--  
I've been too honest with myself, I should have lied like everybody else.





More information about the TAG mailing list