I'm working on a Latex document that uses a lot of complex sub- and superscripts, so I wrote a little snippet
_{$1}
which is activated by the underscore key (and the corresponding thing for ^, of course).
I use this a *lot*, and it has saved my brain a lot of confusion, and my right little finger a lot of wear and tear. But it also has a benefit that I wasn't expecting: when I've finished typing the subscript, I can just press tab to escape from the braces, and continue with the rest of the expression.
I find that invaluable, and I've started to get frustrated that the same thing doesn't work with ordinary auto-completed braces, parentheses, etc. Of course I could write a snippet
{${1:$TM_SELECTED_TEXT}}
and bind it to the { key, but then you don't get the nice feature that deleting the opening brace will delete the closer as well. It would be nice to have the best of both worlds. How about making it possible to tab out of *all* auto-paired thingies, in the way that you can from a snippet?
Robin
On 3/21/07, Robin Houston robin.houston@gmail.com wrote:
I find that invaluable, and I've started to get frustrated that the same thing doesn't work with ordinary auto-completed braces, parentheses, etc. Of course I could write a snippet
{${1:$TM_SELECTED_TEXT}}
and bind it to the { key, but then you don't get the nice feature that deleting the opening brace will delete the closer as well. It would be nice to have the best of both worlds. How about making it possible to tab out of *all* auto-paired thingies, in the way that you can from a snippet?
command + right arrow
On Mar 23, 2007, at 12:13 AM, Ivan Pan wrote:
How about making it possible to tab out of *all* auto-paired thingies, in the way that you can from a snippet?
command + right arrow
That's not quite the same, that takes you at the end of the line.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 3/22/07, Charilaos Skiadas skiadas@hanover.edu wrote:
On Mar 23, 2007, at 12:13 AM, Ivan Pan wrote:
How about making it possible to tab out of *all* auto-paired thingies, in the way that you can from a snippet?
command + right arrow
That's not quite the same, that takes you at the end of the line.
oh yeah, that's right. I am sorry. That does work for me, because it is typically the end of the line for me.
ip
On Mar 23, 2007, at 12:55 AM, Ivan Pan wrote:
On 3/22/07, Charilaos Skiadas skiadas@hanover.edu wrote:
On Mar 23, 2007, at 12:13 AM, Ivan Pan wrote:
How about making it possible to tab out of *all* auto-paired thingies, in the way that you can from a snippet?
command + right arrow
That's not quite the same, that takes you at the end of the line.
oh yeah, that's right. I am sorry. That does work for me, because it is typically the end of the line for me.
ip
Of course you can create a macro that sort of does what you want to do, using a lookahead for anything that's not a closing thing. I.e. do a forward search for something like:
(?=[^])}])
Just record a macro that does such a search, and bind it to your favorite keycombo (preferably not tab). Perhaps one could add some clever space handling as well.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
I have just, belatedly, noticed that this is essentially the fourth question in the TextMate FAQ. I'm torn between:
a) Embarrassment at having committed a faux pas, b) astonishment that you were all too polite to point it out, and c) a sense of vindication, that this behaviour is so commonly-requested as to be a FAQ.
Robin