Emacs vim

Vim vs Emacs: Detailed Comparison

The Linux community is no stranger to heated debates. From discussing the pros and cons of proprietary versus open source software to defending their favorite distributions with the zeal of a knight defending the last redoubt, Linux users can be extremely opinionated, which doesn’t make it easy for newcomers to find useful, unbiased information.

One debate that has been confusing newcomers for decades now revolves around Vim versus Emacs, which are two venerable text editors that many seasoned Linux users and programmers still prefer as alternatives to modern editors and IDEs such as Sublime Text, Visual Studio Code, or IntelliJ.

In this article, we compare Vim and Emacs to explain why comparing these two text editors is like comparing apples to oranges. By the end of this article, you should be able to decide which of the two text editors fits your needs and preferences more and whether you shouldn’t stick with something more modern after all.

Design Philosophy

Vim was first released in 1991 as a direct descendant of vi, a much older screen-oriented text editor originally developed by Bill Joy for the Unix operating system. Vim’s creator, Bram Moolenaar, originally named the editor Vi Imitation, but he later decided to change the meaning of the acronym to Vi Improved. A fan of open-source software, Moolenaar released Vim under a charityware license, encouraging users who enjoy the text editor to donate to children in Uganda.

Just like Vi, Vim is intended to be fast, readily available, and extremely versatile. It comes pre-installed on most Linux distributions, and it’s available for virtually all operating systems. Because Vim is everywhere, it really pays off to know at least the basics because you never know when you’ll need to edit a text file on a system that doesn’t have your favorite text editor.

Emacs has been around since 1976, and its name stands for Editor MACroS. The version of Emacs most people use today is called GNU Emacs, which was created by no other than GNU Project founder Richard Stallman. Just like Vim, Emacs runs on basically all operating systems you will ever come across. However, because it’s a relatively large piece of software, it usually doesn’t come pre-installed.

The reason why Emacs is large has everything to do with the fact that it’s much closer to an operating system than a text editor. It features a Turing complete programming language, Emacs Lisp, which makes it possible to customize and extend Emacs in ways that the mind has trouble comprehending. To illustrate what we mean, we encourage you to visit the website of GNEVE, a video editor for Emacs.

Ease of Use

The image above perfectly illustrates the learning curves of Vi/Vim, Emacs, and other popular text editors. With Vim, all you need to do to get started is open just about any cheatsheet you find on Google Images in a separate window and play with the keybindings for a while. Initially, you won’t even know how to edit a text file, but it won’t take you more than a couple of hours to know all the basics.  You can even download a GUI version of VIM, such as gVim, to add menus and toolbars for commonly used commands, making the editor even easier to learn.

Emacs is sort of like a sandbox game. You start with an unlabeled brown box that’s packed with tools capable of accomplishing just about anything you could possibly imagine, included editing text files. The only problem is that there’s no obvious way how to approach this sandbox. While there are cheatsheets and tutorials online, but you can spend hours with them, and you will barely scratch the surface of what Emacs can do. Yes, it can be extremely rewarding to know Emacs’ ins and outs, but you should ask yourself if the journey is worth the effort.

Productivity

Vim is a fast text editor that opens instantly and presents its users with two modes: insert mode and command mode. The former is where you type text into the editor, while the latter is where you enter keyboard shortcuts to execute various commands. Emacs takes slightly longer to start, and it’s modeless, just like most text editors today.

Even though Emacs can take as much as 2–3 seconds to load on older systems, most users don’t mind at all because they never close it. Instead, they open Emacs in shell mode, allowing them to run shell in Emacs, instead of the other way around. With shell running inside Emacs, you can more or less live inside the software 24/7 and use it to do everything from listening to music to taking notes to playing games.

Needless to say, it’s easy to get distracted with Emacs if you’re the type of person who likes to tinker with software. But if you manage to stay focus and use Emacs to improve your workflow, your productivity can skyrocket. For pure text editing, Vim is usually faster, but experience plays a huge role in this regard.

Customizability and Extensibility

Both Vim and Emacs support plugins that can enhance their functionality, Emacs takes customizability and extensibility a step further with its Emacs Lisp programming language. Because Emacs Lisp is Touring complete, its capabilities are limitless.

Would you like to search Google straight from Emacs? Just run the following Emacs Lips code, type M-x prelude-google, and this new command will instantly work:

(defun prelude-google ()
"Googles a query or region if any."
(interactive)
(browse-url
(concat
"http://www.google.com/search?ie=utf-8&oe=utf-8&q="
(if mark-active
(buffer-substring (region-beginning) (region-end))
(read-string "Google: ")))))

To learn more about the impressive extensibility of Emacs, we recommend you read this article written by Bozhidar Batsov, the author of the code snippet above.

When Vim users feel like they’re missing certain functionality, they typically grab one of the thousands and thousands readily available Vim plugins. However, they can also use Vimscript, Vim’s internal scripting language. Both Vim and Emacs additionally support themes, so there’s nothing stopping you from pretending to be Neo from Matrix.

Conclusion

As we’ve said in the beginning, comparing Vim with Emacs is like comparing apples with oranges. One is capable text-editor with many advanced features aimed at power users, while the other is a sandbox that just happens to be great for editing text files. If you’re happy with your current workflow and just want an alternative to modern text editors like Sublime Text, Vim is the way to go. But if you would like to completely reimagine how you edit text files and write software applications, Emacs can give you everything you could ask for and more.

Vim:

  • More straightforward and easier to learn than Emacs.
  • Better as a text editor.
  • Pre-installed on most Linux distributions.

Emacs:

  • Extremely powerful and infinitely extendable.
  • Fantastic support for GNU tools.
  • Embodies the programming mindset.

About the author

David Morelo

David Morelo

Content writer and copywriter, researcher, wannabe linguistic, part-time marketer, gym rat, sometimes annoying but always loving boyfriend.

I was born and raised in the Czech Republic, where I studied English and Japanese philology at the Palacký University in Olomouc, the second oldest university in the Czech Republic and the largest university in Moravia, one of the historical Czech lands.