当使用vim乳胶时,gq会导致标题中出现悬垂

当使用vim乳胶时,gq会导致标题中出现悬垂,vim,latex,reformat,Vim,Latex,Reformat,当我使用Vim LaTeX编辑一个LaTeX文件,并想重新格式化\caption{}中的一段文本时,我会遇到悬垂或悬垂-我不知道该怎么称呼它们。我首先选择标题中的文本,然后使用“gq”重新格式化它。重新格式化后,标题如下所示: \caption{The problem is that when I reformat the text in a caption the text on each successive line begins further an

当我使用
Vim LaTeX
编辑一个LaTeX文件,并想重新格式化
\caption{}
中的一段文本时,我会遇到悬垂或悬垂-我不知道该怎么称呼它们。我首先选择标题中的文本,然后使用“gq”重新格式化它。重新格式化后,标题如下所示:

    \caption{The problem is that when I reformat the text
         in a caption the text on each successive line
      begins further and further to the left until it begins 
   at the first space of the line.}
我希望结果是这样的:

    \caption{The problem is that when I reformat the text
         in a caption the text on each successive line
         begins further and further to the left until it 
         begins at the first space of the line.}
我希望这篇文章中的格式与我输入的内容保持一致,但我试图在第一个示例标题中描述这个问题。第二个应该左对齐


有人知道我需要做什么来解决这个问题吗?我假设有一个需要更改的设置,但我无法确定它是什么。

基于
'formatexpr'
'formatprg'
gq
命令格式。首先,您可以使用
:se-fex?
:se-fp?
检查这些选项的值


通过查看
vim-latex
插件,它从不设置这些选项,因此这可能是由您的其他插件或vimrc设置的。您可以使用
:verbose

找到选项设置的确切位置。首先,如果您迟到了,我会投赞成票,但显然
'formatexpr'
'formatprg'
都没有在我的设置中设置,所以这还没有帮助。一个可能推动这一进程的后续问题。我发现,如果文本被移动到与{}不在同一行,那么它的格式就正确了——不幸的是,我不知道如何通过在这里提供一个好的示例来澄清。但是如果我从
\caption{some text}
改为
\caption{
-然后我把
“some text”
放在一个新行上,然后再把
}
放在另一行上。我可以选择文本,
gq
将正确格式化。