开发者

How can I disable code folding in vim with vim-latex?

开发者 https://www.devze.com 2023-01-08 21:06 出处:网络
I have tried the usual approaches, and have read :help tex.vim (see : http://vimdoc.sourceforge.net/htmldoc/syntax.html )

I have tried the usual approaches, and have read :help tex.vim (see : http://vimdoc.sourceforge.net/htmldoc/syntax.html )

I've taken a brief look at syntax/tex.vim, but can't see how to disable it without rebuilding vim without folding. I'm sick of hitting 'zE'.

Lines 开发者_运维百科I've tried in my .vimrc:

set foldlevel=manual
set foldlevelstart=99
let g:tex_fold_enabled=0


Just noticed that there are variables to control folding in vim-latex-suite, at least as of v1.6 of the plugin. The functionality is documented here: http://vim-latex.sourceforge.net/documentation/latex-suite.html#latex-folding

In short you should be able to change three global variables to get rid of all folding:

 :let Tex_FoldedSections=""
 :let Tex_FoldedEnvironments=""
 :let Tex_FoldedMisc=""

That should get rid of all folding. If you want to disable some folding but not all then you can control things by setting the appropriate values for each variable, as described in the documentation link above. Hope that helps.


What about

autocmd Filetype tex setlocal nofoldenable


The folding functionality all seems to located in folding.vim file of latex-suite distribution. This file is referenced in line 825 of my main.vim file in the latex-suite folder of the ftplugin folder. That line reads:

exe 'source '.fnameescape(s:path.'/folding.vim')

Comment out that line and, as far as I can tell, it strips out all the folding in latex-suite plugin. I don't think it affects anything else, but I haven't checked.

0

精彩评论

暂无评论...
验证码 换一张
取 消