Small TextMate tip

Here’s a small TextMate tip I discovered today. Normally, some TextMate functions don’t work too well with Ruby code. Word selection and keyword completion ignore Ruby-specific characters like : or ? or !. For example, if you used somewhere method like blank? and then you type bl and press Esc, TextMate will complete it as blank, ignoring the ? at the end. And don’t even get me started about when you double click blank? and the ? is not selected.

To change it, go to the Preferences (CMD-,) and select Text Editing tab. At the bottom, there’s an editbox labeled Word characters containing a single _ by default. Add characters :?! to this editbox, close the window and you’re done. Enjoy!

There’s one caveat, however. This setting is global and affects word selection and keyword completion in all files. If you edit many other types of files, that could be a problem.


5 responses to “Small TextMate tip

  • Paul

    why not using netbeans with awsome code completion? :)

  • szeryf

    because TextMate is cool, light, known and just good enough for our needs?

  • Paul

    i dunno, lack of refactoring is a big disadvantage for me. I never really used TextMate so I cannot compare it.

  • Paul

    After your post I wanted to give TextMate a try.
    sudo apt-get install textmate gives “E: Couldn’t find package textmate”. Hmmm wtf? Quick google search and I got

    “Allan has received numerous requests for Microsoft Windows and Linux version of TextMate, but has publicly stated that he has no interest in making such ports.”

    No TextMate for me I guess. Any alternatives? Possibly for Ubuntu?

  • szeryf

    Yeah, it’s really a shame TM is only available for Mac OS X. Not being a Linux user, I can’t tell if there’s a decent replacement of TextMate for it. I’ve heard about some clones for Windows (one called E Text Editor), maybe they have Linux versions.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: