vim || emacs || nano: the great holy war

by debianjoe

Image

(or…why I don’t care and you shouldn’t either)

 As I mentioned in my very first post, those of us in the Unix world are a highly opinionated bunch.  This is especially true regarding what may be the most pointless of all discussions that has ever taken place.

“Which text editor is best.”

I will be the first to admit that I’m a very strong supporter of gnu-emacs.  I write some lisp, and I like the convenience of having everything that I ever use within a few commands of where I currently am.  If I want irc, I have erc.  If I want a mail-reader or RSS reader, I have gnus.  If I want a file manager, I have dired.  At any given time, somewhere on my screen (or in another opened tty), is an emacs window.  I once preached the glorious wonders of emacs from atop my pulpit, and then I did something crazy.

………I made a partition that only had vi as an editor.

I did this because I was stuck one day trying to merge a commit via ssh on a corporate machine, and I had to simply comment why the merge was necessary.  Much to my dismay, vi was the default editor on this system.  I had to go and search out how to insert text and save changes in vi.  Despite the fact that I could control the world from emacs, I was totally crippled by a simple “add text and save” on a different editor.  This upset me to a great degree, so I made this partition, installed a very basic linux distro on it, and then spent the next few weeks using nothing but vi.  Eventually, I allowed myself the freedom to use vim instead of vi alone.  Since then, I’ve become very comfortable using vim.

What this has eventually led to is that I still use emacs for many things.  I still use it as a constant in everyday use.  It’s just too great at being all of the things that I need within a few quick key-presses.  Still, there is one situation where I’ll use vim: if I know that I’m going to be doing nothing but writing and editing code for a few hours.  I have found that leaving my hand on the home row of keys, and having numerical arguments for cursor movements is actually faster than performing the longer key-chains that emacs uses.  My vim install isn’t really all that vim can be (and if you start looking at plug-ins…it is highly extensible), but for where I prefer it over emacs, there isn’t much need for it to be.

I’m sure that the mob of loyal emacsers who are currently gathering outside to burn me at the stake for such heresy might be heard shouting “…but you can get that same functionality in emacs with ____” and that’s true.  Still, I like my emacs like I have it.  For 90% of what I do, it’s perfect.  For the other 9%, I like a very simple vim.

If you’re paying attention, those only add up to 99%, so what about the other 1%?

GNU-nano.  When you need to edit a file that’s only 3-4 lines long, from just a prompt, nano is a fine choice.  It is standard in many versions of Linux (especially install disks), and is so easy to use that anyone can figure it out in a very short period of time.  Nano is a cool little tool to have, and it prevents having to use ed/cat to edit everything.  This is a great reason to have it around.

So, where I’m really going with this long anecdote is that I would prefer to see all users know at least the very most basics of the major text editors.  It can save you a lot of difficulty should you ever be forced to work in an unfamiliar environment.  Also, like much of everything else that we enjoy fighting over in the Unix world, these editors are all really very good.  It’s just that I’ve found that they can  each edge each other out for use on very specific tasks.  Is that reason enough to install all of them and only use the most appropriate one for the job?  Probably not, but that’s up to each user to decide.  Neither emacs or vim are particularly small in file-size.  Once you start adding extensions and plug-ins, they can quickly become monolithic programs that are better served by running a daemon+client than opening them regularly.  I would say that you have to weigh the difference between the amount of storage space and memory you have to spare and how often you find yourself editing text.  It’s up to the user to decide if the additional weight of each program is worth the benefits.

If you’re looking for a colorizing cli editor, and you don’t have much space to spare, then nano is probably perfect for you.

Advertisements