Linux.com

Home

Vim Tip: Using "paste" to Avoid the Staircase Effect

Article Source Dissociated Press
December 22, 2009, 1:37 pm

If you're working in Vim and paste something into the terminal, sometimes you'll get a "staircase" effect where each line is progressively spaced farther outward, like so:

line 1  line 2   line 3    line 4 

Obviously, this isn't usually desirable.

To correct this, you can enable paste to prevent the staircase effect. In command mode, type:

:set paste

This isn't on by default. When paste is enabled, it disables mapping and some other functions, so you probably want to know how to turn it off as well:

:set nopaste

Happy vimming!

 

Comments

Subscribe to Comments Feed

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board