A look at venerable text editors

OK, so what are us kids who have never fully embraced the power of command-line editors such as vim and emacs really missing?[^n] Let's find out. I'll compare primarily to my main editor Sublime Text (ST), with WebStorm and Atom as backups. I've used a lot of GUI editors over the years but Sublime Text was the first text editor that really felt smooth and powerful, thanks largely to clever default keyboard shortcuts, lots of plugins, and customization.[^n]

Let's start with a community size comparison:[^n]

Now, this is a self-selected group with about 17k StackOverflow users in 2015, and surveying other groups such as Arch Linux users shows a less extreme but significant difference. These numbers matter. A lot. Most importantly, it shows the size of the community available to build plugins, fix bugs, and share your experience. While vim seems more promising in this respect, it appears that emacs editors may be more rabid devoted, because they rounded up enough online votes to beat vim 51-49 in a Rackspace-solicited competition.

Vim has a unique modal interface. When in 'normal mode', text cannot be edited. Instead, vim lets you jump around by prefixing commands with numbers: 30j moves you 30 lines down, 30k moves you 30 lines up, and so on. This is where much of its power lies. You can also specify where you want to go by line or column number precisely, how many characters or words to delete, etc. Technically emacs has a similar functionality, but it is less complete, accessible and tied exclusively to the Control and Meta keys. Emacs also has modes, but these are mostly tied to contexts such as programming languages.

Emacs is known for running everything from a browser to a mail client to a file manager. The old joke is that "... emacs is a great operating system ... lack[ing] a good editor". But supporting that sprawling infrastructure is not easy, and my cursory review of various plugins shows that many of them are either abandoned or loosely-maintained.

It would seemingly be simple to have two highly-skilled users of both software do a 'speed battle', and I believe that's been done but I couldn't find any reports online. I suspect vim would win because at the end of the day, in 'normal mode' it lets you manipulate text and move faster. Emacs is more of another text editor inside of a terminal with lots of cool plugins. That's not to discount its significance: it has a lot of plugins. It inspired Yukihiro Matz in the creation of Ruby. And emacs has "Evil Mode" which gives you the power of vim navigation inside emacs.

ST and emacs are therefore similar: they are text editors with a lot of plugins, but emacs a head start of a couple dozen years. The cool things that you can do with emacs as shown in videos[^n] are theoretically possible or already implemented in ST or Atom (and I haven't found anything too amazing that ST doesn't have). Emacs plugins inspired the features of modern editors. Atom already has a vim mode extension, making articles like Why Atom Can’t Replace Vim questionable. See awesome-emacs for a big list of emacs plugins.

Vim is also extensible. However, it hasn't it become a sprawling do-it-all application like emacs. This may not be due only to community philosophy. Vim has one major developer Bram Moolenaar who is known for resistance to change.[^n] Plugins must be written in a more limited unique language Vimscript, and its architecture may make it more difficult to hack on.

Now, the best way to get your feet wet with Vim is definitely the built-in vimtutor, and it's really not that hard if you put a little time in. Emacs also has a built-in tutorial accessible with Ctrl-H + t. At some point I may do a post or two explaining my own setups. But these are not my primary editors, and I use vim more than emacs.

< PrincessLeia2> :q
< PrincessLeia2> oops
< TonicBH> what kind of face is that?
< PrincessLeia2> not a facey, I was trying to quit vim

[^n]: This post is inspired by the common job question "what are your editing tools". If nothing else, vim or especially emacs lets you stand out from the crowd. The answer to the Quora question Do young people who use old text editors do it for the signaling value? is: yes, for some people. Like many of the respondents, I began using vim and emacs because I was editing remote files, and in bash you can drop into emacs mode to write multi-line scripts (Ctrl-x, Ctrl-e).
[^n]: I've bounced around, using Notepad++, Kate, Geany, Visual Studio, and a few Python-specific IDEs over the years.
[^n]: See Quora's Are there more Emacs or Vim users?.
[^n]: See Emacs Power: Can your editor do THIS! and Emacs Introduction and Demonstration, and of course the Emacs rocks series.
[^n]: In touting the Neovim project, one vim user said that vim is "the worst C codebase I have seen" and that the maintainer's "merge criteria are inscrutable". Not that the GNU Project is accepting of change.