The other day I went back to an old branch that had about five files that were changed and I only wanted to incorporate two of them into my master branch. In order to just merge in a couple, I used git merge with the –no-commit option.

git merge --no-commit planner

This merges in all changes but doesn’t commit it. Since it isn’t committed, it’s easy to roll back individual files. I ran git status to get a list of files and rolled back several files with git checkout. When I was done, I had only the two files I wanted to merge showing up when I ran git status.

Yesterday I started trying out Vimperator, and so far I’m impressed. It’s a Firefox extension that puts a vim-like keyboard interface on top of Firefox.

After using it for a while, I wanted to turn the bell off, because I find it to be distracting. I turned to the documentation. I quickly found a visual bell option, but I find visual bells to be even more distracting. Then I saw the visual bell CSS style option, which can be set to an empty string for no bell at all. Bingo! Or so I thought.

It turns out that the page flickers when the bell is triggered. This is not the desired effect. So after searching the docs one more time, I unpacked a jar and poked around in the source code of Vimperator.

There’s a beep function in there. I changed the beep function to return false and Voila! It did nothing when you scrolled past the bottom or top of the page.

Rather than keep the code patched, though, I figured out how to implement my change in my ~/.vimperatorrc file. There’s a javascript command for executing a line of javascript. Vimperator’s beep function is in a global “liberator” object. Combining these two bits of knowledge, I came up with the following line which can be added to ~/.vimperatorrc:

javascript liberator.beep = function() { return false; }

It’s simple but it works. It would be nice if completely disabling the bell (including any visual artifacts) were built into Vimperator, but being able to fix it with a one-liner in the configuration file is the next best thing! Kudos to the Vimperator developers for writing code that’s easy to modify.

I’m not sure how often I’ll use Vimperator. I need to learn how easy it is to pass the input through to the current web page first. But it certainly seems to do a difficult job remarkably well!

Update: I started a Silencing and Disabling Bells WikiBook and put instructions for disabling bells in Vimperator, MacVim, and iTerm in it. Contributions welcome!

I’m at the Merb and Rails 3 community forum with Yehuda Katz and Matt Amionetti right now. It’s an event with no agenda; they just opened the floor to questions. I asked them a couple of questions about Merb slices.

First, I asked them what would happen with slices in Rails 3. They explained that slices are going away in future versions of Rails and Merb, but the functionality will still be there. Instead of having slices, applications will simply be “mountable” within other applications.

I then asked if components such as models could be shared between slices. Yehuda said that their goal was to give all applications a namespace by default. He then went on to say that hopefully there will be no need to refer to an application’s namespace from within the application.

This sounds great! With a few contributions from the community, it should be at least as easy to install multiple apps into a site and get them sharing stuff as it currently is in Django.

After watching the Meet Emacs screencast on Peepcode and talking to a few local developers who use emacs, I’ve started using emacs again. Since I started playing around with it several weeks ago, I’ve learned about a number of useful features I either hadn’t used before or had just barely scratched the surface of. These include the following:

  • ido-mode – A tool for quickly finding files that uses a combination of history and intelligent name searching.
  • hippie-expand – Intelligently completes part of a word to match another word in the current buffer.
  • text macros – I’d seen this before but didn’t realize how often it can be done in place of a regex search-and-replace. Much more intuitive, too.
  • C-x C-v – Unlike the more commonly used C-x C-f, which loads a file in a new buffer, visit-file (C-x C-v) loads a file in the current buffer. This solves a common annoyance for me of opening the wrong file in the right directory, and having to choose between leaving the wrong file open or navigating back to the right directory after closing the wrong file.

These are things I wouldn’t have noticed if I had still been blindly following the Pragmatic Programmer tip, Use a Single Editor Well. The problem with picking an editor and sticking to it is that there really isn’t a way to learn how good an editor is without actually using it.

I’m also starting to think that maybe, even after I’ve gained a pretty good understanding of most editors, I still won’t want to pick a single editor. Maybe I’ll use emacs for some things and TextMate for others. Using more than one editor might not be for everybody, but for people who take a serious interest in editors, it might be a good idea.

I put my emacs dotfiles directory up on GitHub, if anyone is curious about the customizations I’ve made to it.

So far I like my new setup, and I’m using Emacs most of the time. I’m getting to be quite comfortable in it. I’ve dealt with a couple of things that used to annoy me most about emacs, which are confusing indentation and inaccurate syntax highlighting. I dealt with the former by setting the tab key to go to the next tab key, rather than use the current mode’s indentation code. To deal with the latter, I just turned off syntax highlighting. I’m actually quite comfortable without it most of the time, and if I really want pretty syntax highlighting, I can always fire up TextMate.

In the future, I may continue to use emacs as my primary editor, or I may not. If not, I don’t think my time learning Emacs will have gone to waste, as I’ll have learned new editor features and I’ll know what to look for when I explore the advanced features of whichever editor I’m using.

As stated before on this blog, I’m a heavy twitter user. I tried to quit twitter and found that it was hard to leave. Eventually I just gave in. Now I’m following somewhere between 100 and 200 accounts.

Sometimes I want to say or quote something that’s just below 140 characters, but I feel obligated to provide some context. In those situations, I usually wind up cutting out some punctuation or text in order to fit a shortened URL. Not anymore—if it’s searchable.

I created a new twitter account called @srch. If you click on the twitter ID, it takes you to @srch’s twitter profile. On that page are instructions that will let the savvy user know that if they have decent searching skills, they can probably find where the text came from.

Please let me know what you think of this idea.