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
!. 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.