2012-03-08 53 views
3

在一個LaTeX文件中,我有幾個分散在各處的verbatim部分。vim如何重新格式化`gq`以避免觸及TeX逐字部分?

當我想重新格式化整個文檔時,我通常使用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} 

是否有vim的一個智能 TeX的格式化另一個命令?

回答

1

我通常使用gq}來重新格式化本段的其餘部分。我懷疑在沒有編寫/使用腳本的情況下無法做你想做的事情。

LaTeX Box不公佈此功能,但任何人都應該實現它,該腳本將成爲此功能的自然之家。