You're viewing a post from the archive. Don't forget to checkout our latest post Let them eat State

Quick Textmate tip

Gravatar
25 May 2007

For all those people making Rails apps in Textmate, here's a little thing that I've suggested to other people in the office recently. It affects people like me, who generally cd into my rails app and run mate . to open up the entire thing in everyone's favourite editor. The problem in this situation, which most of us have encountered at one point or other, occurs when doing a find in project. There is a certain sinking feeling you get as you press the find button, and at that exact moment, realise that the log and tmp directories (which have been accumulating in size over the last month) are gonna be searched as well. The ball starts spinning and there's nothing you can do...

One solution to this is to remove the directories manually, and optionally save the project for the future. But that is boring, and can lead to mistakes. Enter neato trick in the form of folder references. If you go to Preferences > Advanced > Folder References, you can see the regular expression in the second box for folders that TextMate will ignore.

If you change it to this, your log directory will be ignored automatically:


!.*/(\.[^/]*|log|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$

If you are feeling Spartan, you could also add sessions, cache, rails and anything else you don't search often which that slows search down.

I hope this is helpful to someone, it seemed rather obvious but overlooked feature to me.