2

I have downloaded and successfully installed the Vim-LaTeX Suite from http://vim-latex.sf.net.

It is a great tool, but slightly annoying that when you open a file it folds all of the text and puts the folds in a collapsed state, as this page of the manual states:

http://vim-latex.sf.net/documentation/latex-suite/latex-folding.html

So you have to type zR to expand everything each time you open a LaTeX file.

Typing zR is obviously not hugely annoying, but I was wondering if there was an easy way to disable this functionality, so that the file is displayed with the folds uncollapsed by default?

4

3 回答 3

3

将以下内容放入~/.vim/after/ftplugin/tex.vim

setlocal foldlevel=999

这样,折叠保持不变,所有折叠只为 Latex 文件打开。您可以使用 关闭所有折叠zM

(这要求您有:filetype plugin on; 使用after目录允许您覆盖任何由 . 完成的默认文件类型设置$VIMRUNTIME/ftplugin/<filetype>.vim。)或者,您可以:autocmd FileType <filetype> setlocal直接在您的~/.vimrc.

于 2013-05-23T10:32:40.190 回答
1

将以下行添加到您的~/.vimrc

set nofoldenable
于 2013-05-23T10:16:32.643 回答
0

或设置foldlevel为更高的值,例如999

实际上,zM、zR 也设置了这个选项。

于 2013-05-23T10:23:50.497 回答