loading...
Cover image for Time To End The vi/Emacs Debate

Time To End The vi/Emacs Debate

realedwintorres profile image Edwin Torres Updated on ・2 min read

I originally posted this article at BLOG@CACM.

There has been a long-standing debate among programmers. It is as fierce as the Hatfields/McCoys, Jets/Sharks, and Michigan/Ohio State feuds. Programmers continue to argue over the best text editor: vi or Emacs. For the past 42 years, programmers have dug in on either side, with practically no hope of switching. I must disclose that I have been using vi since 1987. I still remember my classmates arbitrarily picking vi or Emacs. I tried emacs back then and did not like it. Maybe I did not give it a fair chance? Well it is too late now. I am in the vi camp for life.

Now the developers have spoken. Stack Overflow just released its 2018 Developer Survey Results. Vim, the improved version of vi, scored 25.8% in popularity, while Emacs scored a paltry 4.1%. That is a staggering difference. To further gauge popularity, I counted 22,582 questions tagged with vim and 15,667 questions tagged with Emacs on Stack Overflow. You could argue that fewer questions means higher usability. I interpret this as an indication of activity.

I know the Atom and Sublime Text editors are all the rage today. But what made vi appealing to me 30 years ago still holds true today. I really like the short, simple commands. I rarely need to take my hand off the keyboard. To delete a character, type ‘x’. To insert a character, type ‘i’. If you still type Ctrl+x, Ctrl+s to save a file, I do not think we can be friends. I like how my brain has been hardwired to vi. I probably cannot describe most of the vi commands to you, because using vi is like breathing: you just do it. MIT and Stanford each have nice little vi reference cards that fit on a single page. The GNU Emacs reference card is twice as long. Invoking the emacs editor requires three additional letters; those extra keystrokes add up over time. Finally, vi is a cool name. I have a cousin who goes by Vi. Have you ever met anyone named Emacs?

If you still use Emacs, I feel for you. Perhaps it is time to give vi a try. I consider myself lucky for picking vi from the start. You can try to convince me to use Emacs, but you will have an easier time convincing me to go back to Visual Basic.

Edwin Torres is a full-time software engineer at The MITRE Corporation and an adjunct professor of computer science at Monmouth University. Follow Edwin on Twitter @realEdwinTorres.

Photo credit: enver uçarer, link

Discussion

pic
Editor guide
Collapse
serhuz profile image
Sergei Munovarov

I've been wondering why these editors are still around. I mean, we have IDEs and on rare occasions when there's a need for interactive git rebase it's easier to use nano.

Am I doing something wrong?

Collapse
xowap profile image
Rémy 🤖

Well, you're using nano... I never know how to do anything in nano, it's stressful. vim is much simpler and a pretty good editor to use over SSH

Collapse
mgaruccio profile image
mgaruccio

Vi is ideal for editing config files, particularly inside of ssh sessions. It's also arguably just as easy to use as nano for things like rebases once you've learned the basic commands.

Beyond that the keybindings allow for some insanely quick text editing but require a bunch of time to learn, so not sure where the break-even point us in terms of time saved....

Collapse
zendhetmij profile image
zend

I have been using nano for year before thinking I needed more for remote access using ssh. For me I notices that after only 10 minutes in the vimtutor i was on the same level as my nano skills. maybe this gives an estimate for your breakeven point.

AFter that doing each day a few lessons on the vimtutor made it even easier to use vim and really saved more time editing.

I believe I'm still close to the level that vimtutor thought me, because honestly I don't need much more for my remote editing. maybe I picked up a a few tricks when I had specific needs that I googled. Programming I still prefer to do in a complete ide, simply because it saves time, just like vim does for me in the cli.

Saying that vim had a steep learning curve probably procrastinated my choice to try VIM. It actually is pretty easy and fast to learn, you just have to invest 10 minutes to get started using vimtutor. I think that learning the same tricks in other ide's took even more time, but the keystrokes are ofter the same i give you.

Collapse
dpasi314 profile image
Dante Pasionek

I find using an editor such as Vim makes it easier for me to program across multiple languages. Most of the IDEs I've used (with the exception of some like IntelliJ which may be primarily for Java also has Scala functionalities as well) It seems cluttered to me to have an IDE for each language I use when I can use the command line and Vim and get the same done. Academia forces me to be multi-lingual when it comes to programming. I've used Python, C/++, Java, Scala as well as a few query languages. Using IntelliJ, MS. Visual Studio, and PyCharm seems to be a lot. Using vim (with plugins) makes transitioning a lot easier for me.

That all being said, if you're developing in only a few languages then I would see why an IDE would be useful. I wouldn't necessarily say you're doing something wrong. At this point it's more of a question of taste versus functionality I feel.

Collapse
realedwintorres profile image
Edwin Torres Author

It's probably because sometimes a simple text editor on a non-windows system is all you need. vi and Emacs are bundled with Linux. If you're not running X Windows, then you're not going to have a graphical IDE.

Collapse
serhuz profile image
Sergei Munovarov

So does it mean vi & emacs application is limited to editing configs via ssh?

Thread Thread
realedwintorres profile image
Edwin Torres Author

Both vi and Emacs are plain text editors. Use both to edit text files in the file system.

Collapse
rbanffy profile image
Ricardo Bánffy

Both Emacs and Vim are very lightweight and fast. Also, they are easy to use over terminals on remote computers.

Collapse
kayis profile image
K

Probably old-school devs and hipsters ;)

Collapse
ilemming profile image
M-x tips

You're missing the point. Vim is not about a single editor (Vim, MacVim, Neovim etc.) - it's an idea. Idea that can be implemented in other IDEs.
It's an awesome idea. Probably the best idea since the dawn of typed input.
And you might be surprised to find out that Emacs today can actually Vim better than Vim itself. Try Spacemacs.

Collapse
martingbrown profile image
Martin G. Brown

22,582 questions asking how to exit vim isn't a good endorsement😉

It is also interesting to note from the survey that most the vim fans are system admins which is probably due to it being about the only editor you can guarantee to be in a Linux distribution.

Collapse
realedwintorres profile image
Edwin Torres Author

Hah! Another reason to use vi!

Collapse
pmcgowan profile image
p-mcgowan

Horay vim! I still find :x in git from time to time when I use sublime...
I tried emacs too breifly, but to be fair I didn't like vim at the time either. Vim has its place in my workflow as does sublime. I got vim-multiple-cursors and ctrlp-vim and that's more than enough for putting out production fires.
I love sublime and vim for the same reason I hated eclipse - do fewer things well as opposed to everything poorly (or average). I will always tend towards lightweight, performant editors/IDEs as I value performance and speed over sugar.

Collapse
realedwintorres profile image
Edwin Torres Author

Typos like that make vi endearing to me. :-)

Collapse
rbanffy profile image
Ricardo Bánffy

Popularity is not quality. Vim is my favorite configuration file editor. Emacs is my favorite IDE.

Collapse
realedwintorres profile image
Edwin Torres Author

Isn't it confusing going back and forth between the vim and Emacs syntax? After all these years, I still have vim commands to learn.

Collapse
ysgard profile image
Jan Van Uytven

Emacs + evil gives you the power of emacs with vim’s Keybinds

Thread Thread
deciduously profile image
Ben Lovy

Or use Spacemacs, which takes the pain out of configuring it. You can choose evil-mode on first run.

Collapse
idanarye profile image
Idan Arye

The appeal of Emacs was being a super-configurable editor, where the editor itself is just another plugin - which means that every plugin author has as much power as the editor developers. Another property of Emacs was it's willingness to consume much more system resources in order to provide the user with more features and flexibility.

Doesn't that remind you of Atom? VSCode also shares that architecture, and Sublime - while using a more conventional architecture - is also extremely configurable.

The appeal of Vim is modal editing. Very few other editors share that idea - like Neovim (which doesn't really count, since outside the Vim vs. Neovim debate Neovim users will identify as Vim users) and Kakoune (which still has only a tiny market share...). Can't think of any others...

My point is that those appealed by Emacs can find the same appeal in many other editors, and have probably spread out to them, while those appealed by Vim need to stick with Vim. That's why Vim keeps it's market share after so many years - because no one bothered to imitate it...

Collapse
zendhetmij profile image
zend

Great read to jump start my morning, loved the humor.
For some reason I started out with nano and learned vi later and still do configuration files using nano. Going to use vi a bit more from now on... After downloading the check because I need them ;).

Collapse
realedwintorres profile image
Edwin Torres Author

Thanks for recognizing the humor! Glad it made your day. ;-)

Collapse
beauslim profile image
Beauregard Slim

I've used both. I like emacs more but since some form of vi is almost always pre-installed on even the most minimalist/embedded unix-ish machines I pretty much always use vi.

But I have to ask: Why on earth do you care what editor other people are using?

Collapse
realedwintorres profile image
Edwin Torres Author

It's just an on-going debate among programmers. I just find it funny.

Collapse
diouanemohamed profile image
Mohamed Diouane

nano is my favorite

Collapse
realedwintorres profile image
Edwin Torres Author

Yes. I like that one too!

Collapse
raymondchen625 profile image
Raymond

Still remember the shock the first time I saw a guy used Nano. I can understand vim, Emacs or even moving the file to Windows to edit. But Nano?

Collapse
larisho profile image
Gab

You're not taking into account the fact that emacs has it's own stackexchange with thousands more questions than the vi stackexchange (which is still in beta). Looks like the war still rages on...

Collapse
realedwintorres profile image
Edwin Torres Author

Ah, true. I missed that. However, the vi/vim stackexchange has 2,000 more users, and it's 5 months younger. ;-)