2009-05-18

Indentation problem when pasting into vim and the nopaste option

When pasting content into vim, such as a code snippet, it may mess up the indentation in a nested kind of way, with indentation increasing the further down you go.

The vim paste option fixes this - just issue :set paste before pasting, and :set nopaste when done.

As noted by the vim documentation, the underlying problem is that a terminal program, in contrast to a GUI one, may not recognize the difference between pasted and typed text.

No comments: