Gedit Find in Files - Now with Ack! »

Created at: 21.11.2009 19:02, source: Hackido, tagged: gedit plugins linux rails python

I've been hacking away on the Find in Files plugin for a while now. As of the last iteration I was fairly happy with the way things were, but there was one thing really missing: Speed.

I could search through my Rails app directory with no problem but if I was in the full root then searching through the development log and plugins would result in the machine freezing up for up to 2 minutes while grep worked its way through the filesystem. Thankfully, Find in Files now uses Ack which speeds things up tremendously.


Ack is perfect for this plugin. Looking at the benchmarks, you can see it's over 4x faster than grep for searching through documents and subdirectories. This will be clearly noticeable to anyone who uses this new version of the plugin. It is much faster.

The issue is that we can't assume people have Ack installed so the plugin gracefully degrades to grep if it can't detect Ack properly. One warning, on Debian and Ubuntu systems, the package is not installed by default. Actually, the ack package in Karmic Koala is a Kanji translator.. so in order to get the right version to use with this plugin, get the ack-grep package instead.

sudo apt-get install ack-grep


If you need to run this plugin on another platform you may need to change the command or create a symlink between ack-grep and your local ack command. Sorry about that.. Linux is a bit too diverse for me to cleanly figure out how to access ack across all distributions. But for Debian and Ubuntu you should be good to go out of the box assuming you have ack-grep installed.

Get the updated plugin from GitHub. Happy hacking everyone!


more »

Recent Update to Gedit Find in Files »

Created at: 30.06.2009 06:18, source: Hackido, tagged: gedit plugins rails python

I've updated the Find in Files plugin for Gedit again. It should be a tiny bit faster and also be able to search special characters. That means you can search for "<%= link_to" instead of just "%= link_to". (Characters are now properly escaped.) The conflict with the Find in Documents plugin should also work.

The original instructions for using the plugin were on my old site, but the gist is that you (may) need SnapOpen and need to enable the default File Browser plugin. Once you enable the File in Files plugin a 3rd tab will appear at the bottom of the screen. Typing in any search results there will display any matching files under your File Browser root with matching results. Basically a glorified grep -R


Update [11-20-2009]: New version released which supports Ack.

At some point I may get ambitious and add the ability to exclude log files, but for the moment I'd suggest only searching within a modest scope. i.e. searching within your Rails App folder? Ok! Searching within your Rails Root folder? Not such a great idea because of the potentially large log files and also all the plugins you may have. You can try it but you've been warned..

Again, I welcome any contributions or forks, so please have at it. Gedit plugins are written in Python or C and I don't program either particularly well.



more »