[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: VIM Behavior Modification

> > I am using vim and am having problems pasting content into a file while
> > using vim. vim is "auto-indenting" based on the previous line, so the
> > pasted text is quickly mauled and tabbed out more and more every line
> > (for large chunks of text, this is completely unmanageable).
> > 
> > However, when I am programming, I make use of this feature. How can
> > I selectively turn this feature on and off?

You might consider something similar to the following in your .vimrc:

    :autocmd!                           " clears autocommands

    :autocmd FileType * set noai        " default is not auto-indent

    :autocmd FileType c,cpp,cc set ai   " auto-indent in program code

Christopher S. Swingley         930 Koyukuk Drive
System / Network Manager        University of Alaska Fairbanks
IARC -- Frontier Program        Fairbanks, AK 99775

phone: 907-474-2689             fax: 907-474-2643
email: cswingle@iarc.uaf.edu    GNUPG and PGP2 keys at my web site
  web: http://www.frontier.iarc.uaf.edu/~cswingle

Attachment: pgpmXdDWbLjLw.pgp
Description: PGP signature

Reply to: