ok so I am trying to do couple advanced snippets and is not working
[quote]<binding key="/(.+)#(.+)/,tab" command="insertSnippet '...' $1 $2">
pretty self explanatory, anyways, it passes capturing group 1 from regex but it won’t pass any other group from then on…
the second argument is passed as ‘$2’ instead of the text after the “#” sign
Am I missing something or is this a bug ?
[/quote]
EDIT:Fixed, see below
Also for regex replacement in snippets, works but is REALLY buggy. Try this one for example
[code]# ${1/./-/g}
${1:$SELECTION}
${1/./-/g}[/code]
So whenever I type anything for my comment header, the above section and below should replace anything that im typing with “-”
final result would look something like this
[code]
--------------------------
Lorem ipsum dolor sit amet
--------------------------[/code]
Now with the following example the regex replacement works wonderful
snippet taken directly from sublimator in one of topics in the forum
<content><![CDATA[-module (${1:${TM_FILEPATH/^.*[\\|\/](.*)\.php$/$1/g}}).]]></content>
which it would do -module NAMEOFFILE (without the extension in this case .php)
I would also like to request conditional snippets and for us to be able to run python in them?
like if $PARAM1==’#’ { do this } else { do this one }
something like that, I think it would just be the icing on the cake for snippets, specially ability to run python commands on them!
Can I get some input on this? Are they bugs are they going to get improved? Jon you still around?
I am compiling a series of screencast and overall doing some “marketing” stuff that I am going to release to jon/public so people can see why sublime IMO is the best sh*t out there for serious coders! lol
I think it will improve popularity of sublime and overall just give the editor and author what it needs, some big kudos and recognition around the world, and more sales of course
BUT there are a couple things that need to get fixed in order for me to succeed in my “bragging? lol” showcasing of the power of sublime (don’t get me wrong it kicks ass already I am just picky!)
I would greatly appreciate some input from you guys so let me know!
P.S. BTW sublime editor is only reason I started learning/doing python!