Since 1976, the Emacs—short for Editor MACroS—family of text editors continues to evolve thanks to its vibrant developer community. Based on an extensible core engine that uses a dialect of the Lisp language, Emacs is one of the most customizable text editors in existence. What gives Emacs its longevity? It’s the cool packages that transform your Emacs experience into anything you can conceive of, enhancing your productivity in new and imaginative ways. Take a look at this rundown of the most interesting and productivity enhancing Emacs packages for 2021.
A powerful text editor
The Emacs text editor, which was designed for POSIX operating systems, is available on Linux, macOS, Windows, and other operating systems. Here are just a few reasons it still has a loyal following today:
- Productivity: Emacs is a customizable productivity environment that can also become a full desktop environment. For example, it helps keep track of projects, tasks, and events; organizes email and chats; and manages remote servers.
- Keyboard-driven interface: Emacs offers powerful, flexible key bindings and key maps you can configure for specific modes.
- Customizable environment: You can customize all aspects of your environment. For example, you can modify the user interface for all applications, the help system, the file and workspace tabs, and the fonts and colors for UI elements.
- Powerful Org Mode: Beyond using Emacs for to-do lists, planning, and writing, it can do literate programming, spreadsheets, and even system configuration.
17 best Emacs packages for productivity
This curated list focuses on the 17 best Emacs packages that enhance general productivity. It doesn’t include packages for specific programming languages.
Magit provides a complete, text-based Git integration solution directly into Emacs. By using Magit, you can perform Git activities such as committing code and performing diff operations. And you don’t have to ever leave the editor, which is an important feature for preserving context flow. Magit is faster and more intuitive than using a Git command line or graphical user interface for both Git novices and experts alike.
Figure 1. Magit screen showing the status buffer. Source: Magit.vc
2. Tabnine AI-powered development partner
Tabnine’s AI code suggestion package uses a machine learning model to analyze the ever-growing open-source community code base that’s available on public repositories such as GitHub. With this training model and massive data set, Tabnine’s AI quickly helps you produce clean code through intelligent code completion suggestions.
Tabnine evolves as you use it by studying your preferences and providing customized suggestions tailored to your needs. Beyond speeding up development with smart suggestions and producing clean, legible code, Tabnine’s GPT-2 AI uses a dual model system that separates your private code from the larger data set to ensure your code remains private and secure. Tabnine is a commercial product, but the basic AI model is freely available to anyone while the Pro version remains completely free for students.
Figure 2. Tabnine screen showing language autocompletion. Source: Tabnine
Evil gets its namesake from its purpose: extensible vi layer for Emacs. Many developers feel uncomfortable with Emacs’ default keyboard mapping. But, by using the Evil for Emacs package, you can introduce Vim-like visual selection and text objects directly into Emacs along with powerful and customizable keyboard mapping features. You can further extend Evil with bindings for Ediff, Magit, mu4e, and Lispyville.
Figure 3. Evil example showing key translation. Source: Evil on Emacs Wiki
Projectile is a project interaction library package. It provides a set of features for operating on a project level without introducing external dependencies. With Projectile, you can easily jump to a project file, project buffer, or recently visited files. You can also switch between files using the same base name with a different extension (for example: .h or .cpp) and switch between projects. Plus, it offers many other tasks that you can perform on a project level. If you’re considering the Projectile package, also consider Project Explorer, a tree-view project explorer that integrates with Projectile.
Figure 4. Projectile running on a project. Source: Projectile.mx
Built on top of the Dired file browser, the sunrise-commander package integrates a powerful dual-pane file browser into Emacs. Sunrise-commander provides unique file management features. Some of these features include: path history, smart file comparison, directory comparison, multiple layout options, sticky searches, archive navigation, and terminal services.
Figure 5. Sunrise Commander file. Source: Sunrise Commander on Emacs Wiki
When navigating a large code base, it’s easy to get lost and forget where to return to a previous section of code you were just working on. You can prevent this situation by using Goto-last-change. This package uses Emacs’ undo buffer to identify areas in the code that you recently modified. It helps you to navigate quickly to a previous position without undoing changes to the code.
Figure 6. Sample of Goto-last-change. Source: Goto-last-change on Emacs Wiki
Minimap adds a sidebar overview of the code you’re working on in the main Emacs’ window. You can customize the layout, font, and sizes of the coding elements, such as the function names, to ensure legibility. You can also quickly navigate through the code area by scrolling the cursor up and down within the sidebar.
The Helm-swoop package shows lines that match a pattern in another buffer. By using helm-swoop, you quickly jump to and edit recurring elements within your code base without having to crawl slowly through multiple search results to find what you’re looking for.
9. Visual bookmarks
Visual bookmarks helps code navigation by providing visible, buffer-local bookmarks. It also provides the ability to jump forward and backward to the next bookmark. This package is ideal if you’re missing a bookmark feature similar to Microsoft Visual Studio.
Rainbow-delimiters highlights delimiters such as parentheses, brackets, or braces based on their nested depth. Each delimiter’s level is highlighted in a distinct color, making it simple to identify matching delimiters, orient yourself in the code, and determine which elements are at any given depth.
Focus works by dimming text outside your current area of interest, so you can easily focus on your current coding activity. You can customize Focus to dim areas by sentence, paragraph, or code block.
Crux refers to collection of ridiculously useful extensions for Emacs. It enhances the editing experience by adding a multitude of utility commands that are just plain useful in everyday development. Here are some examples:
- Duplicate and comment the current line
- Kill all open buffers except the one you’re currently using
- Open the current file with an external program
- Open recently used files
13. Undo Fu session
Undo Fu session replaces Emacs’ built-in undo functionality with a powerful undo system that’s capable of performing undo/redo operations across sessions. The enhanced functionality ensures that undo/redo operations continue functioning even after closing and re-opening files or even Emacs. It works by saving the session’s undo buffer in a separate file and loading it as soon as you resume editing.
YASnippet is a templating system for Emacs. You can use it to type an abbreviation and have it automatically expand into function templates. Using YASnippet saves time so you don’t have to repeatedly and manually write the same basic code structures. YASnippet supports C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, CSS, and more.
Maintaining tidy code is important for legibility, especially if others are reviewing your code or if you go back to review code that you haven’t touched in a long time. Aggressive-indent-mode forces proper text indentation as you edit code and insert new lines. It’s an ideal package to ensure your code remains clear, without wasting time manually setting indentation on each line of code.
Apheleia is an Emacs package that automatically formats code to make it more legible every time you save the code base. Unlike many code-formatting tools, Apheleia works asynchronously to restructure your code without actually pausing your work as it’s processing. Code is reformatted in the background and applied only when Apheleia detects that formatting has changed. Apheleia uses smart logic to prevent a jump in your current cursor position, so you can continue working without interruption, even as your code is formatted in real time.
A reliable text editor for over 40 years and still going strong
Even after over 40 years of continuous development, Emacs packages continue to surprise and innovate with cool new features that increase your productivity and workflow. From AI machine learning code predictions to smooth Git integration, Emacs demonstrates that it can continue to evolve in tandem with new technologies and developers’ shifting, modern-day requirements.