[Vim-latex-devel] Re: A bug in templates.vim
Brought to you by:
srinathava,
tmaas
From: Zhang L. <zl...@ls...> - 2003-11-28 14:35:28
|
Hi, Srinath, I have modified folding.vim (see attachment) to create fold items based on some lists. Since it is not easy to define a clean syntax to cover all situations with a single list, I have created three separate lists for folding environments (g:Tex_FoldedEnvironments), commands with a single argument (g:Tex_FoldedCommands), and sectioning commands (g:Tex_FoldedSections), respectively. Fold items not falling into these categories are handled directly as before. The handling of sectioning commands is implemented using a recursive function (FoldSections()). The limitation on the recursion depth shouldn't be a problem because we only have a limited number of sectioning commands. I have also added '<<<' and '>>>' as special markers for users to manually fold a region. The default settings of these lists are enclosed within "if exists('g:Tex_Foldedxxxxx') ... endif", thus users can set their own default values for them in any startup scripts (like ~/.vimrc). E.g., let g:Tex_FoldedEnvironments = '' will supress folding of environments. Please check the code when you have time. Thanks, LB Srinath Avadhanula wrote: >[I am resending this e-mail because I got a very cryptic mail failed >message from MAILER-DAEMON@Knoppix...] > >Hi LB, > >On Sun, 16 Nov 2003, Zhang Lin-bo wrote: > > > >>In the second patch file, folding-patch, are some >>enhancements to syntax folding. Most of them are >>mainly based on my personal taste, please decide >>on your judgement on whether to incorporate >>(some of) them into the official releases :-) >> >> > >Thanks for the patches... I have been pretty busy nowadays with other >things, hence the late reply... > >I have an idea about folding... It is possible that people have entirely >different preferences when it comes to the level of folding... So I have >a suggestion. Why not introduce a setting like g:Tex_FoldedItems which >will be a comma seperated list of the things which people might want >folded... And then each of the lines like: > > " {{{ equation/eqnarray > call AddSyntaxFoldItem ( > \ '^\s*\\begin{eq', > \ '^\s*\\end{eq', > \ 0, > \ 0 > \ ) > " }}} > >can be replaced by > > " {{{ equation/eqnarray > if g:Tex_FoldedItems =~ '\<eq\>' > call AddSyntaxFoldItem ( > \ '^\s*\\begin{eq', > \ '^\s*\\end{eq', > \ 0, > \ 0 > \ ) > endif > " }}} > > >I would be more than happy to include a patch if you take the time to >make a change along these lines... That way the default setting can >include only the basic latex and amslatex items as Mikolaj suggests, but >users can easily extend it using the setting... > >Thanks, >Srinath > > > |