vim does really lovely autoindenting. But what happens when you want to paste in pre-formatted text from somewhere else? All your code indents way off to the side, oh noes! Here's what to do.
:set paste
Okay, now paste.
:set nopaste
Perfect. I rated
this tip "life-changing".
3 comments:
This has been one of the few annoyances vim has presented me when hacking - thanks for the tip.
At least in gentoo when vim is compiled with the vim-with-x flag it automatic prevents autoindent when pasting from the X clipboard(s)
vim-with-x
Global: Link console vim against X11 libraries to enable title and clipboard features in xterm
Local: Link console vim against X11 libraries to enable title and clipboard features in xterm
http://gentoo-portage.com/app-editors/vim/USE#ptabs
Indeed life changing.. Thanks a lot.
Post a Comment