Skip to content

VIM paste as expected

twitter logo github logo ・1 min read  

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>.

twitter logo DISCUSS
Classic DEV Post from May 20 '19

Write faster JavaScript

David J Eddy profile image
AWS Certified (x4), Automated Testing / Continuous Integration / Delivery / Deployment (CI/CDs), Cloud, Containers, Dev(Sec)Ops, Software Engineer.