[TxMt] Bundle for Remind
Allan Odgaard
throw-away-1 at macromates.com
Fri Apr 14 10:24:15 UTC 2006
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).
More information about the textmate
mailing list