Seunghyun Yoo

Posts | Development | About

[EN] How to paste the code without automatic indentation in Vim

Vim provides the paste option not to modify the original text when pasting the code from other applications.

: set paste
: set nopaste

But I don’t want to make an additional toggle macro for this feature. Instead, we can use read command with the ! mark, which means copying data from the standard output.

:r! cat

After pasting the text, just press ctrl + d to finish it.