FindInProject

Q. Find in Project takes down the entire machine and crashes (MBP.)

A. Most likely this is caused by a corrupt font cache. When TextMate displays the results the font cache is involved and this is known to cause serious problems for at least MBP owners. See FontCorruption for a workaround.


Q. How can I improve Find in Project performance?

A. Reduce the number of files searched. There are two ways to do that:

  1. Exclude binary file types. Out-of-the-box TextMate doesn’t know about binary file types, so each time it sees an unknown file extension, it will test if this file appears to be text or binary. To educate TextMate about the state of a given extension you can locate a file with such extension in the project drawer, then bring up the action menu (clicking the gear button in the project drawer or right-click/control-click the file) and select first Treat Files With “.«ext»” Extension as Text and then select it again (to switch it back to binary.)

  2. Exclude folders with irrelevant files (e.g. a cache folder). This can be done by editing the file and folder reference patterns.


Q. How can I limit the search to a specific folder?

A. This will require creating a new project based only on that folder. A way to do that is to drag the folder from the project drawer and onto the TextMate application icon.


Q. How can I limit the search to a particular file type?

A. This is only possible by creating a project consisting of files of this type. If you have installed the mate shell command then you can create ad hoc projects like this:

cd «project folder»
find . -name '.svn' -prune -or -name '*.php' -print0|xargs -0 mate

This constructs a project consisting of only PHP files. It will skip over the special .svn folders.


Q. Are there any faster alternatives?

A. One option is the AckMate plugin, by Trevor Squires. It is not intended for replacing text, but is much faster than Find-in-Project for searches. The latest version should be at the GitHub Downloads page. Be sure to read the project wiki for important configuration instructions.