Friday, October 17, 2008

Pasting in Vim without Formatting

If smartindent, autoindent, and/or cindent are enabled in VIM,
you find that pasting in the vim does a lot right indentation, which
is not desirable always.

Therefore, you may want to disable indentation while pasting.
This can be done as:

:set paste

Paste your buffer content in the VIM. Then revert back
to indentation mode as given below:

:set nopaste

I hope that this tip will help you in saving time and reducing key
presses.
Enjoy VIMming :)