How can vim reformat `gq` so as not to touch verbatim TeX sections?
In a LaTeX file I have several sections verbatim
scattered all over the place.
When I want to reformat an entire document, I usually use gq
. The problem is that this command also collects contiguous lines of verbatim sections. I don't want to gq
reformat my verbatim sections!
Before reformatting:
This is the
line I want to reformat because is spans on two lines and the
first does not fill to the right.
\begin{verbatim}
$ command1
$ command2
\end{verbatim}
After formatting:
This is the line I want to reformat because is spans
on two lines and the first does not fill to the right.
\begin{verbatim} $ command1 $ command2 \end{verbatim}
Is there another command for clever TeX reformatting in vim?
+3
source to share
1 answer