Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I start with the following in a LaTeX document:

\begin{align*}
    u(x, t) &= \frac a2 \int_0^t \dif s \int_{x-a(t-s)}^{x+a(t-s)} \dif y \sin(\omega y) \\
\end{align*}

Then I go on and enter the second line, Vim aligns the &, which is sort of neat. It all goes well just before the first }:

\begin{align*}
    u(x, t) &= \frac a2 \int_0^t \dif s \int_{x-a(t-s)}^{x+a(t-s)} \dif y \sin(\omega y) \\
            &= \frac{1
\end{align*}

Then I enter the } and it does this:

\begin{align*}
    u(x, t) &= \frac a2 \int_0^t \dif s \int_{x-a(t-s)}^{x+a(t-s)} \dif y \sin(\omega y) \\
                  &= \frac{1}
\end{align*}

With every }, it gets indented a little more. After a while, the whole align* is completely unreadable.

How can I make Vim stop doing this?

My complete .vimrc

share|improve this question
    
I have similar issues with html files, would be nice to know how to deal with this. You can try :set noautoindent in the meantime –  Ярослав Рахматуллин Oct 27 '12 at 18:03
    
I use filetype indent, that should do HTML correctly. –  queueoverflow Oct 27 '12 at 18:26
add comment

1 Answer

up vote 3 down vote accepted

I had the same problem. gvim ignored my noautoindent settings in my .vimrc. I checked the settings in a .tex file with :verbose set ai? and it revealed that autoindent was enabled through the vim-latex plugin. To disable indentation after braces put the following code in your .vimrc (or .vim/after/ftplugin/tex.vim):

let g:tex_indent_brace=0

If you do NOT use vim-latex, try to find out which script is causing the indentation.

share|improve this answer
    
This seems to have fixed it. It was set to 1. –  queueoverflow Nov 25 '12 at 20:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.