[TxMt] Puthon folding idea (not really mine)

Alexey Blinov nilcolor at gmail.com
Tue Dec 11 11:11:27 UTC 2007


On Dec 11, 2007 1:28 PM, Allan Odgaard <throw-away-2 at macromates.com> wrote:

> On 11 Dec 2007, at 09:38, Alexey Blinov wrote:
>
> > [...] new folding rule to fold code based on that pair of markers
> > #{{{
> > def test
> >    ...
> > #}}}
> > [...] I can't do it myself yet but i hope someone will...
>
> Have a look at
> http://macromates.com/textmate/manual/navigation_overview#customizing_foldings
>  -- I wanted to say that if you can code Python, I am sure you can
> add the proper patterns, but then I remembered that Python lack
> regexps as first class citizens ;)
>
> Thanks you for link.
So if anyone like an idea here what i do (im on the way to create some
snippet to make fold-marking easier...)

#Python lang dict - change current folding regexp to
# this one catch only next combo (w/o variants)
# # some fold description # {{{
# ...
# # }}}
    foldingStartMarker = '^#\s[\w\s]*(#\s{{{)$';
    foldingStopMarker = '^#\s}}}$';

and it folds nice, leaving `# some fold description # {{{` visible so you
can read your comment for that fold (i'd like to hide `# {{{` but can't
found how yet...)

P.S. Still WIP and i'd like to hear some nice ideas ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20071211/ffe447ac/attachment.html>


More information about the textmate mailing list