Pregunta

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?

¿Fue útil?

Solución

Put the following into ~/.vim/after/ftplugin/tex.vim:

setlocal foldlevel=999

This way, folding is kept intact, and all folds are only opened for Latex files. You can close all folds with zM.

(This requires that you have :filetype plugin on; use of the after directory allows you to override any default filetype settings done by $VIMRUNTIME/ftplugin/<filetype>.vim.) Alternatively, you could define an :autocmd FileType <filetype> setlocal directly in your ~/.vimrc, but this tends to become unwieldy once you have many customizations.

Otros consejos

Add the following line to your ~/.vimrc:

set nofoldenable

or set foldlevel to a higher value, e.g. 999

actually, the zM, zR was setting this option too.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top