Vim has some fancy pants indentation stuff. When it works right it's a pleasure to have, but sometimes it just drives me nuts. One that I've never been able to solve has to do with LaTeX syntax.
Lets say you have this file:
This is a test paragraph. Most of it is innocuous, but the \textit{inline markup code happens to fall over a line break} which is a problem.
% vim: autoindent textwidth=79 ft=tex
If you put your cursor in the first line and hit gqip
to reformat the paragraph, it will format it like this:
This is a test paragraph. Most of it is innocuous, but the \textit{inline
markup code happens to fall over a line break} which is a problem.
But what I would like is this:
This is a test paragraph. Most of it is innocuous, but the \textit{inline
markup code happens to fall over a line break} which is a problem.
Of course I still do want it to auto-indent when I hit enter on a line ending in {
(or {%
. I also want to follow the indent of the previous line, so if I reformat:
This is a test paragraph. Most of it is innocuous, but the \textit{inline markup code happens to fall over a line break} which is a problem.
I would like:
This is a test paragraph. Most of it is innocuous, but the \textit{inline
markup code happens to fall over a line break} which is a problem.
Is there a way I can correct only the use case behavior of formatting paragraphs that have inline markup without affecting other usage scenarios?
autoindent
in the modeline is not necessary, since it is already set by the indentation plugin.