Quantcast
Channel: Turning off auto indent when pasting text into vim - Stack Overflow
Viewing all articles
Browse latest Browse all 28

Answer by TheChetan for Turning off auto indent when pasting text into vim

$
0
0

Another way to paste is via <CR> and dropping the contents of the register (here the global register). See: :h i_ctrl-r and h i_CTRL-R_CTRL-O.

From the vim help documentation:
Insert the contents of a register literally and don't auto-indent. Does the same as pasting with the mouse<MiddleMouse>. Does not replace characters! The '.' register (last inserted text) is still inserted as typed.{not in Vi}

So to paste contents into vim without auto indent, use <CR><CO>* in most unix systems.

Note: this only works if vim is compiled with clipboard.


Viewing all articles
Browse latest Browse all 28

Trending Articles