Question

I've installed the vim-latex-suite and I'd like to customize the folding for use with the labbook package. The labbook package uses \labday, \experiment, and \subexperiment in place of \chapter, \section, and \subsection.

I'd like to customize the folding options with vim-latex-suite in Vim so that \labday, \experiment, and \subexperiment are folded like the traditional sectioning commands.

I've tried adding to my ~/.vim/after/ftplugin/tex.vim the following (but it didn't work)

 " Folding sections
 let g:Tex_FoldedSections = ',labday,experiment,subexperiment'
 " Folding commands
 let g:Tex_FoldedCommands = ',labday,experiment,subexperiment'

Can someone show me how to customize the folding for the labbook package?

Was it helpful?

Solution

I think you should put

let g:Tex_FoldedSections = 'labday,experiment,subexperiment'`

in your .vimrc itself. If you take a look at ftplugin/latex-suite/folding.vim you'll find:

if g:Tex_FoldedSections != '' 
    call Tex_FoldSections(g:Tex_FoldedSections,
        \ '^\s*\\frontmatter\|^\s*\\mainmatter\|^\s*\\backmatter\|'
        \. '^\s*\\begin{thebibliography\|>>>\|^\s*\\endinput\|'
        \. '^\s*\\begin{slide\|^\s*\\end{document')
endif

Which means that setting Tex_FoldedSections after the plugin as already loaded will not work. Also make sure that your sections in your latex file itself are nested correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top