Here, first atempt to create command to set surrounding folding markers. Thanks to Markdown bundle dev ;)<br><br>HTH<br><br>Alexey<br><br>P.S.<br>Command code (not sure about attachment)<br>--------------------------------------------------
<br>#!/usr/bin/env ruby<br># just to remind you of some useful environment variables<br># see Help / Environment Variables for the full list<br>$: << ENV['TM_SUPPORT_PATH'] + '/lib'<br>require 'escape'
<br><br>s = STDIN.read<br>if s.empty? then<br> print "# fold comment here # {{{\n\n# }}}"<br>elsif ENV.has_key? 'TM_SELECTED_TEXT'<br> print "# ${1:fold comment here} # {{{\n#{e_sn s}\n# }}}\n"
<br>else<br> print "# hmm... not sure what is this... # {{{\n#{e_sn s}\n# }}}\n"<br>end<br>--------------------------------------------------<br>Input: Selected text or Line<br>Output: Insert as Snippet<br><br>
<br><div class="gmail_quote">On Dec 11, 2007 2:11 PM, Alexey Blinov <<a href="mailto:nilcolor@gmail.com">nilcolor@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Dec 11, 2007 1:28 PM, Allan Odgaard <<a href="mailto:throw-away-2@macromates.com" target="_blank">throw-away-2@macromates.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 11 Dec 2007, at 09:38, Alexey Blinov wrote:<br><br>> [...] new folding rule to fold code based on that pair of markers<br>> #{{{<br>> def test<br>> ...<br>> #}}}<br>> [...] I can't do it myself yet but i hope someone will...
<br><br>Have a look at <a href="http://macromates.com/textmate/manual/navigation_overview#customizing_foldings" target="_blank">http://macromates.com/textmate/manual/navigation_overview#customizing_foldings</a><br> -- I wanted to say that if you can code Python, I am sure you can
<br>add the proper patterns, but then I remembered that Python lack<br>regexps as first class citizens ;)<br><br></blockquote></div></div>Thanks you for link.<br>So if anyone like an idea here what i do (im on the way to create some snippet to make fold-marking easier...)
<br><br>#Python lang dict - change current folding regexp to<br># this one catch only next combo (w/o variants)<br># # some fold description # {{{<br># ...<br># # }}}<br> foldingStartMarker = '^#\s[\w\s]*(#\s{{{)$';
<br> foldingStopMarker = '^#\s}}}$';<br><br>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...)
<br><br>P.S. Still WIP and i'd like to hear some nice ideas ;)<br>
</blockquote></div><br>