[TxMt] Re: How to Handle Odd Quotes

Rob McBroom mailinglist0 at skurfer.com
Wed Nov 10 20:09:02 UTC 2010

On Nov 10, 2010, at 12:46 PM, Ben Wilson wrote:

> So, don't know the technical phrase for typing one set of quotes and
> getting the other. " becomes "".

TextMate calls them “smart typing pairs”. See 4.1 and 15.4 in the manual.

> But, I'd like to type two graves (``) and have it become (``"), and
> turn off the " to "". I'll even accept one ` to become ``".

As far as I know, the typing pairs can only be triggered by a single character, and can only insert one character to the right of the cursor.

Someone may have a better idea, but what I would do is create a snippet that inserts ``$1"$0 with ` as its tab trigger. So you'd type `⇥ and end up with the desired characters with the cursor in the middle waiting for you to keep typing. Tab again will take you outside the quotes (but so will →, ⌥⌘↩, ⌘↩, etc).

If you want to turn off smart typing pairs entirely, it can be done in the preferences. To do it here and there or for only certain characters would be more difficult.

Rob McBroom

More information about the textmate mailing list