DEV Community

David J Eddy
David J Eddy

Posted on

2 1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs