Vim:防止括号内或某些环境中的断线(乳胶)

时间:2016-02-17 09:50:55

标签: vim latex

我目前正在使用vim-latex插件和自编的tex.vim设置。

但是我通常使用设置为:set tw=80的textwith 80。但是我不希望像

这样的标题中的换行符

\caption{looongwritten text... foo }

或在eqnarrays环境中:

\begin{eqnarray} LOONG formulars unwanrted wrap \end{eqnarray}

有没有办法阻止{}内部和eqnarray等定义环境中的自动换行?

1 个答案:

答案 0 :(得分:0)

试用方程式代码

%s/\\begin{eqnarray}\s*\n*\(\zs[^\(\n\)]*\ze\n\)\\end{eqnarray}/\=substitute(submatch(1),'\n', '', 'g')/gec 

这用于标题,但要确保标题不应包含像\ textit,\ textbf {}之类的子括号......在其中

%s/\\caption{\(\zs\_[^}]*\ze\)}/\=substitute(submatch(1),'\n', ' ', 'g')/gec