Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vim

latex

folding

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
like image 822
James Broadhead Avatar asked Jul 23 '10 21:07

James Broadhead


People also ask

Can you use VIM for LaTeX?

Vim is undoubtedly one of the best editors ever made. LaTeX is an extremely powerful, intelligent typesetter. Vim-LaTeX aims at bringing together the best of both these worlds. We attempt to provide a comprehensive set of tools to view, edit and compile LaTeX documents without needing to ever quit Vim.

What is code folding in vim?

Yanis. March 15, 2020. Folding is a way to hide a chunk of text, and thus unclutter the view. That comes handy when you need to focus on some other part of code, or if you want to get a quick overview of the whole file.

How do I save a fold in Vim?

The problem is that when you close Vim, your artfully folded code returns to its unfolded state. The solution is quite simple - when you are ready to save your folds run the :mkview command. This will save your folds in the current buffer to your viewdir ( :h viewdir ) depending on your environment.


2 Answers

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.

like image 166
Herbert Sitz Avatar answered Oct 24 '22 05:10

Herbert Sitz


What about

autocmd Filetype tex setlocal nofoldenable
like image 24
Peter Avatar answered Oct 24 '22 04:10

Peter