Posted by Vince Wadhwani on May 06, 2008

Regular readers know that I've been using Gedit to do most of the text editing now that I've put away my mac in favor of linux. Leaving Textmate was really hard but luckily there are a few great plugins that help smooth the transition. One of the things that was still missing was an easy way to search for code within my project. There is a Find in Documents plugin but it only searches in documents that you already have open. I decided to modify that plugin to create a new one called Find in Files. Read on for the link and to learn a bit more.

So what does this plugin do? Well, if you're using the filebrowser in your sidepane, it will search for an expression within all files beneath that path. So if you've got a rails project for instance, you can look within it to find a particular code snippet.

There are plenty of limitations though.. for one it doesn't do well with special characters. So if you're looking for "foo" better to search foo rather than <%= foo %>. It also doesn't do well searching multiple directories down.. I haven't spent a lot of time looking into that to find out why but maybe I will at some point. I am not a python programmer so unfortunately this is more of a hack than it is a program. Much of the credit should go to Mike Doty (the author of Find in Documents) and Mads Buus Jensen (the author of the SnapOpen plugin).

Ok, enough babbling, get the plugin here. Hopefully if you're having TextMate withdrawal after moving to linux this, along with the previous examples, will help you on your way to recovery. Happy coding!