Choosing Emacs vs. Vim

Emacs vs. Vim | InMotion Hosting

Is there anything you wouldn’t give for freedom? That’s what the Emacs text editor is all about. If you’re going to spend most of your day working in a text editor, wouldn’t you want the text editor that gives you the most freedom over how you work?

This article is part of the Emacs Education channel. Emacs is a text editor but also a productivity system for anyone who uses plain text for organizing projects or managing private cloud servers.

Often, the argument around text editors can drown out the important differences between different editors and how they can help you do your work at a higher level. Too often, the focus is on features rather than freedom.

Every text editor has unique strengths and weaknesses. That’s why the argument persists, and it’s why you should know more about these text editors and what the differences may be. You should also take these various editors for a test drive to see how they work first hand.

This guide is part of our Emacs education channel, so the benefits of the Emacs text editor will be more heavily represented. Nevertheless, in reading this article you might decide it’s not for you. In either case, the purpose of this article is to present some background and cover different options.

Basic Text Editors

Most new users will start off using a basic text editor. This means you would use the one that comes with your computer, like Mac OS’s TextEdit or the Windows default Notepad.

Or, you might install a more advanced editor like Sublime, Atom, Brackets, or other.

These text editors do exactly what they’re supposed to do. They allow the user to edit files in plain text that can be parsed by an interpreter or compiler and run as individual programs.

While most of these editors cover the basic feature set, they also provide some extra niceties, which you are best advised to explore at your leisure. It is these extra features that set various editors apart and help you decide which features help you get your work done.

Multi-line editing feature in Sublime text.

Integrated Development Environments

At the next level up you have an integrated development environment (IDE). These are usually expensive but they are geared up to optimize and enhance the features of th basic text editor and literally “integrate” all of the external features you might need to speed up your development process, including debugging and version control.

PHPStorm from JetBrains tip window, launches on startup.

Integrated development environments are typically built around a certain programming language. For example, JetBrains produces IDEs built around PHP, C, Ruby, Python, and more.

However, some IDEs, like Microsoft Visual Studio Code (VSC) provide IDE support for multiple languages (and it’s free).

Emacs and Vim, the editors I’ll be comparing more directly in this article, belong to the category of modal editors.

Modal editors basically give you different modes based on what type of work you’re doing.

But the different modes, of course, work differently in Emacs and Vim.

In Vim, you have Insert mode (in which you insert text) and Command mode (in which you run commands on the text).

Emacs mixes those modes in some ways, unless you have your Emacs set up to use Vim commands (more on that elsewhere).

In this sense, modal editors can be set up like IDEs, depending on how you want to use them. The point is, they’re fully customizable.

Weighing and Trying Different Editors

You would be best advised to try many different kinds of editors from all across the board.

A lot of popular text editors are free to use. Even expensive IDEs will provide a free trial version you can install and use for a predefined period.

In the case of Vim, you can try it by opening virtually any terminal editor and typing vim.

In the case of Emacs, you will need to first install the program and open it as you would any application. If you’ve never used Emacs before, you should start with the Emacs tutorial. You can open the tutorial by typing C-h t (holding down the control key on your keyboard and pressing “H”, followed by “t”).

Emacs tutorial startup screen.

The Emacs Difference

The Emacs way of working starts with the basics, as any text editor does:

  • Editing and saving files
  • Enabling special modes for coding and other tasks

Then you can progress along to customizing your Emacs with alternate color schemes, display modes, look and feel, behavior, and custom key commands.

Eventually, you can start playing with your own Lisp coding. Emacs provides its own language, Emacs Lisp, which is a Turing complete programming language. From that point, you have ultimate freedom to make Emacs do whatever you need it to do.

Porting Vim Into Emacs

One of the primary expedients that Vim users love about Vim is the vast array of key commands. The experienced Vim, once in command mode, can fly to any point in a document and executed advanced editing commands with a few keystrokes.

In addition to Vim’s widespread availability in most operating systems, it is these key commands that keep most Vim users away from exploring the advantages of Emacs.

This is why a group of Vim users ported the Vim keys over to Emacs. By installing “evil mode” in your Emacs configuration, you can use the advanced Vim key commands and take advantage of the powerful time-saving features of Emacs like Org Mode and many others.

The Final Emacs Vs Vim Tally

Place your bets.

Desirable featuresEmacsVim
Superior file editing
Fast, intuitive key commands
Rich library of plugins
Proprietary file navigator 
Editing remote files in single session 
Self-documenting 
Graphical user interface 
Git integration 
Spotify music player 
Watch videos 
Play Doom 

You may not need many of these features, but they demonstrate the capabilities that Emacs offers.

Server File Editing and Shell

One of the greatest advantages of Emacs for sysadmins or anyone who logs into a server has got to be the TRAMP feature. Built into Emacs core, TRAMP lets you open and edit remote files within your current window.

This means if you want to edit, copy, or paste text in or from a file on a remote server, you could visit that file by simply typing in a file path.

Likewise, if you need a shell instance, you can use Emacs as your terminal emulator. That means you could have all the features of Emacs available in addition to normal shell operation. For example, if you wanted to copy/paste shell output or simply output your shell session to a text file, Emacs lets you easily do that.

The Emacs shell.

Other Weird Features and Support

When it comes to Emacs, the sky’s the limit. Many of the most advanced features come pre-installed, but as you go you can all kinds of packages and custom scripts.

For example, writers will find “word count mode” very useful for setting word goals and tracking the word count of your document.

The Spotify music player lets you enjoy and control your favorite music while in Emacs.

Helm lets you quickly search for files and functions dynamically.

With all the volunteer developers around the world writing packages for Emacs, you’ll never run out of support.

CM
Christopher Maiorana Content Writer II

Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.

More Articles by Christopher

Was this article helpful? Join the conversation!