QA /technical/2009/05/exclude-directories-from-textmate-side-bar-for-faster-find-in-project/

This commit is contained in:
Wesley Moore 2010-03-22 17:41:12 +11:00
parent 2103cc6e44
commit 0ba542043d

View file

@ -1,5 +1,7 @@
I'm not much of a user of TextMate project files, generally preferring to just <code>mate .</code> 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 atttempting 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.
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 <a href="http://gilesbowkett.blogspot.com/2007/06/remove-find-in-project-from-textmate.html?showComment=1182394020000#c8242128871345293431">common solution</a>, 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 <a href="http://stackoverflow.com/questions/216995/how-can-i-use-negative-wildcards-in-a-unix-linux-shell/217004#217004">answer to a question on Stack Overflow</a> I came up with this:
<script src="http://gist.github.com/111999.js"></script>
As the comments in the script note I have this in a file called '<code>ate</code>' in <code>~/Local/bin</code>, which is in my PATH. I can now happily go to any directory, type ate and have it ignore that list of directories.
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.