Some of you know (and the rest of you don’t care) that I spend my actual day job working on a largish JRuby on JRails project. (As an aside, I never get tired of jthrowing that extra j onto janything jthat I jcan. When I wrote the “Jython Essentials” book, I desperately wanted to call it “JProgramming Jython”, but eventually sensible people prevailed.)
Anyhow… our developer stations run Ubuntu, which meant no TextMate. Since Vim and I have, let’s say, significant differences of opinion, I wound up using RubyMine – I’m a longtime JetBrains user, NetBeans drives me a little crazy, and I like RubyMine.
When I’m on my Mac laptop, and not the dev station, I kept up with RubyMine, largely because RubyMine has a big advantage in ways to navigate a project, and that was a major win because of the size of this app. However,my laptop is underpowered compared to the dev stations and running RubyMine and JBoss made it crawl.
With the recent releases of PeepOpen and AckMate, though, I thought it was time to give TextMate another try. That’s the context here… I’m hoping that PeepOpen and AckMate will improve TextMate’s ability to navigate a large project such that it’s usable.
For the record. RubyMine’s advantages over TextMate are: Navigation, including search for symbol, and click on a symbol to find it’s definition. Refactoring, though I actually don’t use that much in practice, and being able to easily run tests inline and get clickable stack traces – for various dumb reasons, I haven’t been able to set that up in TextMate.
TextMate’s advantages are: cleaner interface, easier for me to customize, it’s a better pure editor, and it’s somewhat more performant that RubyMine. Really. Also I use it more, so I’m comfortable with its quirks.
Back to PeepOpen. It’s downloaded and installed like a normal Mac application. After install, when you run it, it sits in the menu bar. Once it’s running you can configure it. You must specify which editor PeepOpen is attached to, current options are Aquaemacs, Coda, Emacs, MacVim, TextMate, and XCode. In most cases, you then need to press a button to install a plugin. The other primary preference is the number of documents to track, to a limit of 4000. This seems fiddly to me, it’s hard to imagine a normal use case where the answer to how many documents PeepCode should track is not going to be “ALL OF THEM”. You can also tweak some options about git integration, and you can set global ignore preferences.
In TextMate, PeepOpen takes over the command-t key command to bring up the fuzzy text finder, with it’s own fuzzy text finder. The PeepOpen window is larger, and displays the directory of each file, a last modified date, information about whether the file is different from the last committed git version. Like the TextMate finder, as you type, it progressively reduces the number of files to that match what you have typed based on some fuzzy text algorithms that match what you have typed against anywhere in the files’ full path name. It also tries to bring more recently used files to the top. In my experience, it was certainly responsive enough, even with 4000 files being managed.
Once I got used to it, it works pretty well, especially once I had spent some time on the project and had some file that had been worked on. I had two issues. The first was a configuration issue. My project had well over 4000 files in it, and if you go over, there’s no indication of it, the only thing that happens is that files that you know are there aren’t being found. Fun. I was eventually able to fix that by tweaking the ignore patterns, but I wonder if that is going to conflict with other projects. Some way to get in project specific ignores would be nice. (Given the way my current project is set up, the git root is not the rails root, so I didn’t see the git information either, but it’s hard to blame PeepOpen for that.)
The second issue is more a question of what I’m used to. The JetBrains/RubyMine fuzzy finder is heavily acronym based, so if I’m looking for a file named “public_profile_integration_spec”, then I can type “ppis”, and JetBrains will put that file to the top. I love this behavior, it almost always uses less keystrokes to filter to the file I’m looking for, and thinking in terms of the acronyms is very natural. PeepOpen’s algorithm works differently, and in this case would list any file with the four characters “p”, “p”, “i”, “s” in order, even if they are not together. Any file with the word “mappings”, for example. It doesn’t privilege the first character of a word, which is too bad, because that is a powerful search.
PeepOpen helped a lot in making TextMate more usable for this project, but it didn’t make it all the way there by itself. That also took AckMate, which is a TextMate plugin providing a nice, very fast, GUI display for Ack searches of the entire project. AckMate is much faster than RubyMine search, and also displays the results with a few lines of context. My only quibble would be that it would be very nice if invoking AckMate would pick up the current text selection as the next search. Other than that minor issue, though, it’s really useful, and allows TextMate to overcome most of the navigation issues it has versus RubyMine.
Weirdly, although it’s been a while since I seriously used TextMate for a Rails project, I seemed to be much more into using the keyboard to navigate open files. That helped, too. It also turned out that invoking the JRuby interpreter to start tests from within RubyMine is much slower than invoking from the command line – that surprised me, because it’s not true in the Ubuntu dev setups.
After all that, I did succeed. I was able to use TextMate effectively on this project in a way that was not possible without PeepOpen and AckMate. So that was good. Probably worth the $9 in time not spent watching Java spin up and down. That said, I still like RubyMine. Having a choice of lots of tools is generally better. Though I still can’t get my fingers to work with Vim…