Chances are, if you’ve spent any significant amount of time with POSIX-compliant systems, you’ve made an effort to learn either emacs or vi. (Unless crontab -e shunts you to nano, and you’ve not moved on.) I suspect that those who stick with emacs are generally programmers, while those who stick with vi are generally sysadmins (although I do recognize that plenty of programmers spend their days in vi – this is a hasty generalization made for the sake of argument). Since both editors are so different in approach, it makes sense to get deeply involved in one to the exclusion to the other. Being proficient in one is eventually more productive then only half-knowing both.
That said, I suggest learning both sets of keybindings.
The reason I suggest this is because many other programs implement either emacs or vi keybindings. By default, bash uses some emacs keybindings for moving around the command-line, although it can be configured to us vi-like bindings too. The aforementioned frankeneditor nano also has emacs-like bindings. Pagers such as more, less, and most utilize vi keybindings. As a systems administrator, at some point you’re going to find yourself on an unfamiliar box, with a less than familiar tool. I guarantee that pulling the old “I wonder if this tool uses vi commands for navigation” trick will result in a percentage increase in productivity that, while completely cooked up off the top of my head, is nevertheless real and measurable.
So. If you’ve slavishly commited yourself to one editor and one set of keybindings to the exclusion of the other: Be Ye Not So Stupid.
I definitely agree, and I regularly use both vi and Emacs. I also think the opposite is true — you should know basic Emacs keybindings. If you are on any Linux system or any system that uses bash or a program that uses GNU Readline, you will have basic Emacs keystrokes at your disposal.
Just the other day, I overheard someone on my ops team tell another, “I figured out how to go back one word in bash, it’s control-b.” It didn’t occur to me that people didn’t know that, it was natural to me because I use Emacs.
Just don’t use them in the wrong IRC channel!
As an in-progress vim-to-emacs convert, there’s another reason to know both sets of bindings (or more accurately, to know vi bindings even if you always use emacs): There are systems out there where the most advanced editor is vi. Not vim, but vi. I’ve needed to do some work on systems like that, and it was difficult enough as a vim user. I can’t imagine how difficult it would be not knowing any bindings at all.
This is definitely true.
Only a fool would be blind to only use one or the other. While I prefer Emacs for editing code (it is much more than an editor, it’s a LISP machine that has file editing functionality by default), vi is suitable for small edits and will always be on any UNIX system.
Also, how can one say they prefer one or the other without learning both to come to a sound conclusion? I tend to ignore people that make seemingly biased judgements on one side but are ignorant of the other.
In my opinion, the arguments most have with “emacs vs vi” have nothing to do with technical matters but is a “my team vs your team” mentality issue. Some seem to want to have this desire to belong to a “team”.
But as for vi keybindings, I’ve never had to use them outside of vi. Emacs keybindings I use everywhere all the time.
I agree vi is worth learning, yet I disagree with the misleading title of learning due to keybindings. Emacs keybindings are in everything by default, vi keybindings are not. Since I started UNIX in 1996, I don’t think I’ve used vi keybindings in anything other than vi or vim.