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?

`filetype indent`

, that should do HTML correctly. – Martin Ueding Oct 27 '12 at 18:26