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


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

    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

  3 Responses to “Disable auto indent when pasting text into vim”

  1. Thanks a lot.. it works

  2. This is what I was looking for. But I was getting permanent solution etc.

  3. Please write what will happen if I forget to use :set nopaste

    What will stop working? Thanks!

    You can help me finding the update here:

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>