vim如何重新格式化'gq'以避免触及TeX逐字记录部分?

vim如何重新格式化'gq'以避免触及TeX逐字记录部分?,vim,latex,reformat,Vim,Latex,Reformat,在一个LaTeX文件中,我有几个逐字部分分散在各处 当我想重新格式化整个文档时,我通常使用gq。问题是,该命令还收集逐字记录节的连续行。我不想gq重新格式化我的逐字记录部分 在重新格式化之前: 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{

在一个LaTeX文件中,我有几个
逐字
部分分散在各处

当我想重新格式化整个文档时,我通常使用
gq
。问题是,该命令还收集逐字记录节的连续行。我不想
gq
重新格式化我的逐字记录部分

在重新格式化之前:

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}
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}
重新格式化后:

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}
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}

在vim中是否还有另一个命令用于smartTeX重新格式化?

我通常使用
gq}
重新格式化段落的其余部分。我怀疑不写/不使用脚本是不可能做你想做的事情的

不宣传此功能,但如果有人实现此功能,脚本将是此功能的天然家园