Differences between Emacs and Vim

Viewed 492044

Without getting into a religious argument about why one is better than the other, what are the practical differences between Emacs and Vim? I'm looking to learn one or the other, but I realize the learning curve for each is high and I can't decide. I have never used an editor of this type (I've always used IDEs), so anything that helps a newbie is a plus.


Before a flame war starts: I'm not asking which is better, I'm asking the differences between the two. I would like an objective comparison.

30 Answers

I have worked with spacemacs for about 2 years and neovim for about a year now in a production/research environment. Spacemacs is emacs with couple of nice extra features like layers etc. And neovim is a fork of vim again with some extra features.

I am quite unsatisfied with both of them in terms of experience. And I am still on the look out for a long term solution for my text editing needs.

Here is a simple comparison:

  • Neovim, vim, emacs, spacemacs, etc all of those editors consume less ressources compared to most of the editors out there.

  • Neovim/vim is slightly faster than emacs, noticably faster than spacemacs.

  • In terms of editing experience. I can easily say that emacs packages feel superior. I think that's because they blend in better with the core of emacs.

  • Vimscript is nice and there are certainly great projects in the vim ecosystem as well. The good thing is they are better documented than most emacs projects I have seen so far.

  • Both can be glitchy depending on the package you are using. Spacemacs tend to freeze, and neovim tend to display scary error messages, so pick your poison there.

  • Modal editing in vim, is not an intuitive concept, but once you get used to it, you want it anywere. Both of the editor provide that.

I was user of vim first, then I switched to emacs, then to vim, now I'm experimenting with emacs again.

  • Both are great editors.
  • Both are very extensible today
  • Both have great plugins and community

As developers we type a lot, and, at last for me, moving around in buffers and files are the biggest repetitive tasks, so I want a editor where I CAN MOVE FAST!

The motivation for experimenting with emacs again is that I fell it Ctrl leaded keybinds faster than vim, and easier to reason about.

In vim you have modes, you have insertion mode, visual mode, normal mode, what happens when you press something depends on the mode that you are, is a stateful aproach to editing. You move, enter in insert mode, edit, get out of insert mode and move again. I frequently lose my self if I miss a ESC press or something like this.

In emacs there is no mode, basically you press Ctrl with your pink and type the keystroke, like C-x C-f, C-x C-s, C-x C-c. There are keybinds where you need to release ctrl key, I hate this ones and always replace them by ones with control pressed.

I think that emacs approach is faster to think and type, but vim has another strength, to. Its commands are composable, they usually has a format . For example, to delete a line you can use dd, to delete a word dw. Plugins make use of that felling, with vim-surround plugin you can delete quotes with ds" (delete surround "), delete up to next / dt/. Delete up to previous /: dT/ and so on. So as long as you learn the moving things start to get very interesting.

Summing up, today I fell that emacs keybinds are faster for macro editing and vim commands are more powerfull for microediting

I've been using vim for the last five years so I edit thinking mainly about words, lines, surrounding, blocks, etc. Delete this line, remove quotes, replace quotes, delete word in cursor, I'm trying to findout the emacs moves for that

As a final quote I would say that, I care more about fzf than about emacs or vim, I would love to have a editor that is completely fzf based

I am an Emacs fan but encourage other developers to learn VI because:

  1. you can use VI to edit the emacs makefiles.
  2. VI includes ed commands and every UNIX user should know ed and sed.

I've noticed several comments about VIM starting faster than emacs. If you really care about that, run emacs in server mode and alias 'emacs' to 'emacsclient'. The client is super fast since all it does is tap the server on the shoulder and tell it which file you want to edit. On MacOSX, emacsclient is only 33K while emacs is 287M.

I'm not sure any of this is necessary on modern hardware. On my MacBook Pro (2013 Retina), emacs loads almost instantaneously when I run it from the shell. I detect no pause at all. When I run Emacs.app (the GUI version) it might take all of 3 seconds.

Most complaints I hear about emacs seem to come from people misinformed about emacs. Having used both vi and emacs since 1982, I definitely remember a time when emacs loaded much slower than vi and used most of the physical memory in my early UNIX boxes, but that is no longer the case and has not been for at least 15-20 years.

One complaint I will concede is "emacs pinkie". This never bothered me at all when I was younger. Now that I'm 58, my pinkie does get a bit sore from repeatedly accessing the Control key for emacs chording. This is especially true on the MacBook Pro keyboard where Control is moved one position to the right to make room for the "fn" key. It's not nearly as annoying when Control is the bottom left key.

Related