DEV Community

David J Eddy
David J Eddy

Posted on

VIM paste as expected

Some time when pasting code around and eventually into VIM the formatting get really messed up; especially if the logic contains commented areas. VIM likes to indent until the end of time.

The quick fix is to set VIMs mode to PASTE, not INSERT. Using the :set paste often does the trick.

To toggle the mode you can set a hotkey like so :set pastetoggle=<F2>.

Top comments (0)