I found myself having vim open for long periods of time, whether it was just the convenience of having a text editor open for random notes, or writing code for long periods of time. I would have my editor open for days on end. Vim, I thought, restricted me somewhat. I had to have multiple windows open: one for vim, one to run my apps, and perhaps another for miscellaneous things. Vim does have good support for buffers, but to really use it like I wanted involved downloading a plugin script for it.
I was pondering these things while reading *The Art of Unix Programming* by Eric Raymond. In it, Raymond makes a great case for using emacs. Though his standpoint is greatly biased, he makes a great point: emacs is written to be by programmers, for programmers. It's written to stay in all day long, with minimum cruft. Vim is trying to get that way, but it obviously isn't there yet. Any why shouldn't I use the original?
I gritted my teeth at this decision -- I've been a loyal vim user since I've started using Unix (which has been all of my professional life, as well as college). Plus I have many tweaks and configurations that I am used to. Am I willing to throw this all away for something with a totally different mindset?
I tend to learn through total immersion, so I needed to use emacs for a while, like a week, before I made a decision on what I should be using. I installed GNU Emacs on my personal Linux box and start going through online tutorials. I found myself hitting ESC a lot, as well as hitting '/' when trying to do a search. Other than that, I liked what I found -- modeless editing was cool, and does feel more natural. Having a shell prompt in a buffer is also nice, and is especially convenient when you need to grab output from there into the file you are editing. I soon installed XEmacs on my Windows machine at work, and began using that for my editing tasks. Most of my days is spent pondering over Python code, and emacs's Python mode is very, very good -- it automatically finds the class names, function, etc. and puts them up in the menu, as well as functions for indentation. You can even use the Python interpreter inside an emacs buffer! Very handy when you are experimenting -- just copy the code from the interpreter to your script!
Then I found other little toys in emacs that I didn't know were there. Like M-x ispell-buffer spell checks buffer inside emacs! Vimspell is nice, but not as nice that that. And it's standard in emacs, as opposed to "yet another macro to install when using a new system" like vimspell would be.
So now I'm hooked. I will be using emacs now for all my major projects, and some of my minor ones. I am by no means 100% comfortable with emacs -- I still look at my quick reference card, but I'm just starting out. If you need a change of pace, come aboard!
Got something to add? Send me email.
More Articles by Mike Hostetler © 2009-11-07 Mike Hostetler