Hiding Image Files in TextMate

Here’s how to hide JPG, PNG, and GIF files in your TextMate projects so bulk file operations go faster.

TextMateTextMate, perhaps the best generic programming editor that I’ve ever encountered (though I’d be willing to entertain reader suggestions), has the ability to open an entire directory at once, which is great for making bulk changes to automatically generated website files.

However, there’s one trick that I keep having to look up each time I do it, and that’s how to get that side-bar directory listing of the project files not to display image files. The reason you might want to do this is for efficient global replace options across all text-based site files.

The solution is to click the top-level directory in the project, and press the I button in the bottom right corner of the drawer.

This opens a Folder Information dialog box. In the area labeled Recursively Include Contents Matching there are two fields, one for files and one for folders. In the File Pattern field, enter this regular expression: !\.(jpg|png|gif)$

When you close the Folder Information dialog box, all files with the extensions listed will no longer be displayed.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.