[TxMt] Bundle for Remind
Rupa Deadwyler
djbidi at gmail.com
Sun Apr 16 00:28:00 UTC 2006
Sweet. I couldn't get it to work exactly as described (I had lots of
problems with getting the scope of the caret right), but with some wrangling
- and making sure that certain rules came in the right order - it seems to
be working. I was even able to get "smart deletion" (where backspace deletes
both your smart quotes) with a similar trick.
rock!
> ---------- Forwarded message ----------
> From: Allan Odgaard <throw-away-1 at macromates.com>
> To: TextMate users <textmate at lists.macromates.com>
> Date: Fri, 14 Apr 2006 12:24:15 +0200
> Subject: Re: [TxMt] Bundle for Remind
> On 13/4/2006, at 5:49, Rupa Deadwyler wrote:
>
> > I need to figure out how to scope functions() that have other
> > functions inside them, my first regex was not good at all. And I
> > wish I could get %" to be completed as Smart Typing Pairs, but it
> > seems you can only have one character in them :(
>
> You sort of can. You need to add a rule to the language grammar, e.g.:
>
> { match = '%(\s)';
> captures = {
> 1 = { name = "meta.incomplete-string-or-whatever"; };
> };
> },
>
> Now when you enter % in the source, the scope of the caret should be
> the one shown above. So create a snippet which inserts whatever needs
> insertion ("$1"%) and give that snippet a key equivalent of " and
> scope of source.remind meta.incomplete-string-or-whatever.
>
> Then if you type %" in a source.remind file, you should get %""% with
> the caret in the middle, and you can press tab to skip out of this
> string.
>
> The rule is made so that this only works when the character following
> the % is a whitespace character (which includes newlines, so it also
> works when typing at the end of a line).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20060415/4b7003b1/attachment.html>
More information about the textmate
mailing list