TextMate: Speed up searching in a project (CMD+Shift+F)

I hate how slow TextMate is when searching in a project. Well, it turns out that it is not really because TextMate's search is slow. It might be. Most likely, the real problem is that, by default, TextMate is searching through ALL your Rails files. ALL, as in logs, vendor/rails, and so forth. This is what is slowing things down.

I don't take any credit for this. This is a tip from Dr. Nic on a TextMate Google Groups thread. But, I will distill it down for you.

Copy this crazy looking piece of regex (at least . . . I think it is regex):

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


Fire up TextMate.

Open up Preferences. ("CMD + ," for the cool people.)

Go to Advanced -> Folder References

Picture 1


In the "Folder Pattern" field, delete what is there (you may want to save it somewhere . . . I just gmailed it to myself), and paste in the crazy regex from above.

Done!

Now, TextMate in project search will be much faster!


About this entry


0 comments: