WezM.net Menu

Exclude Directories From TextMate Side Bar for Faster Find in Project

Published on Fri, 15 May 2009

I’m not much of a user of TextMate project files, generally preferring to just mate . in a directory. This works great until the directory or one under it contains large, irrelevant files like log files or database dumps. Its at this point you start encounter massive slow downs in the otherwise very useful ‘Find in Project…’ function. The slow downs turn into crashes if the files are big enough as this results in TextMate attempting to grab vast amounts of memory. Eventually the OS tells it to, “bugger off, 1Gb is all I can give you”, or something along those lines.

A common solution, particularly when working on Rails projects is to create a shell alias that just invokes mate with the directories of interest. This works ok but given I’m working on a mix of project types (Pylons, Rails, Radiant) I wanted a solution that did the reverse: Choose everything except what I want to exclude. Informed by an answer to a question on Stack Overflow I came up with this:

As the comments in the script note I have this in a file called ’ate’ in ~/Local/bin, which is in my PATH. I can now happily go to any directory, type ate and have it ignore that list of directories.

Comment icon Stay in touch!

Follow me on Twitter, or Mastodon, subscribe to the feed, or send me an email.