Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Mar 082011
 

Disable auto indent when pasting text into vim

Answer:

When you copy multiple lines text and paste it into the vim , sometimes you might find the text is aligned wrongly as the following:

Line1 
    Line 2
        Line 3
            Line 4

To solve this problem, enter the paste mode by

: set paste

Then do all the pasting works, and when finished, type

: set nopaste