Essential Emacs Packages for Efficient Software Development and Text Editing

In the pursuit of an optimized Emacs setup, I focused on enhancing defaults and minimizing the number of installed packages to maintain simplicity and efficiency:

  • The initial step involved creating minimal-emacs.d, a project that has resonated with the Emacs community, providing a foundational template for many users’ init.el and early-init.el vanilla Emacs configuration.
  • Next, I experimented with hundreds of Emacs packages, carefully selecting the most valuable ones that, ideally, leverage built-in Emacs functions. (This is why I chose corfu chosen over company, eglot over lsp-mode, and flymake over flycheck, etc.)

In this article, I will share the Emacs packages I use daily for software development and text editing. Please share in the comments the Emacs packages you are using!

Where can I find the third-party packages listed below?

The following Emacs packages installed whether from MELPA or ELPA.

Category: Code completion

  • corfu: A completion framework that integrates with the built-in completion system in Emacs. For example, it can complete Python code when using the eglot package and a Python language server such as Pylsp.
  • prescient: Provides smart completion suggestions based on history and context. For example, it can enable fuzzy completion with Corfu/Cape or anticipate your next input based on previous selections.
  • cape: A completion-at-point extension for various completion frameworks in Emacs, enhancing Corfu.
  • nerd-icons-corfu: Integrates Nerd Icons with the Corfu completion framework, enhancing the appearance of completion candidates.

Category: Software development (General)

  • eglot (built-in): An LSP client that provides features like code completion, diagnostics, formatting, and more, powered by language servers. For example, it can be used to add Python code completion using the language server Pylsp. There are many language servers available for many other programming languages.
  • outline-indent: Enables code folding based on indentation levels. This package is useful for editing indentation-based text files, such as YAML, Python, and other indented text files.
  • treesit (built-in): This package provides a way to work with tree-sitter, a syntax code parser that performs syntax highlighting, code navigation, and structural editing across various programming languages.
  • hl-todo: Highlights TODO keywords in your code, helping to track tasks and reminders.
  • highlight-symbol: Highlights occurrences of symbols in your code.
  • reformatter: Define commands which run reformatters on the current Emacs buffer
  • flymake (built-in): An on-the-fly syntax checking system that works well with eglot.
  • indent-bars: Provides indentation guide-bars.
  • paren (built-in): Matching parenthesis highlighting.
  • ws-butler: Automatically trim extraneous white-space only in edited lines.
  • yasnippet: A template system for Emacs that allows for easy insertion of code snippets, improving coding efficiency. (The author is also using ultyas to share the same code snippets in Emacs and Vim)
  • rainbow-delimiters: Colorizes matching parentheses, brackets, and braces, improving code readability.
  • dtrt-indent: Automatically adjusts indentation based on the surrounding context in code files, improving code readability.

Category: Version Control System

  • magit: A comprehensive interface for Git within Emacs, allowing for easy version control operations.
  • diff-hl: Displays git diff information in the fringe of your Emacs window.
  • git-gutter: Displays git diff information in the fringe of your Emacs window. (alternative to diff-hl.)

Category: Better minibuffer

  • consult: Provides intelligent search and navigation commands, powered by the Emacs completion function, completing-read.
  • vertico: A performant and minimalistic vertical completion UI based on the default completion system
  • marginalia: Enhances the display of completion candidates in the minibuffer.
  • embark: Enhances minibuffer completion and interaction with various Emacs commands and actions.
  • wgrep: Allows for in-buffer editing of grep results, improving the usability of search results. It can be used with Consult/Embark.

Category: Session management / persist and restore

  • easysession: A lightweight Emacs session manager that can persist and restore file editing buffers, indirect buffers/clones, Dired buffers, the tab-bar, and the Emacs frames (with or without the Emacs frames size, width, and height).
  • saveplace (built-in): Persist and restore your current cursor position.
  • savehist (built-in): Persist and restore your Emacs command history.

Category: Themes

  • tomorrow-night-deepblue-theme: A blue color theme for Emacs inspired by the Tomorrow Night color scheme.
  • ef-themes: A collection of light and dark themes for GNU Emacs whose goal is to provide colorful themes.

Category: Vim emulation

  • evil: An extensible vi layer for Emacs, providing a modal editing experience similar to Vim.
  • evil-collection: A collection of Emacs packages that integrate with Evil mode to provide consistent keybindings across multiple modes.
  • evil-snipe: Provides enhanced search and jump functionality for Evil mode.
  • evil-surround: Enhances text object handling in Evil mode, allowing for easier manipulation of surrounding characters.
  • vdiff: Provides a visual interface for comparing two versions of a file that is similar to the Vim editor.
  • vim-tab-bar: Provides a tab-bar interface reminiscent of Vim, allowing for better management of multiple buffers and windows in Emacs.

Category: Terminal Emulators

  • eat: A terminal emulator, written in Elisp.
  • vterm: A terminal emulator for Emacs, written in C.

Category: Undo/Redo

  • undo-fu: An advanced undo/redo system that enhances the default undo behavior in Emacs.
  • undo-fu-session: Integrates with undo-fu to provide session management for undo history, enhancing undo capabilities across sessions.

Category: Miscellaneous file types

  • org (built-in): A powerful mode for organizing notes, tasks, and project planning within Emacs.
  • org-appear: Improves the visibility of Org mode elements in the buffer by automatically toggling visibility based on context.
  • toc-org: Automatically generates a table of contents for Org mode documents.
  • rainbow-mode: Provides colorized display for hex color codes in the buffer.
  • markdown-mode: Provides major mode support for editing Markdown files.
  • markdown-toc: Automatically generates and manages a table of contents for Markdown files, making navigation easier.
  • git-modes: A collection of major and minor modes for various Git-related files, improving the editing experience.
  • lua-mode: Provides major mode support for editing Lua files.
  • php-mode: Provides major mode support for editing PHP files.
  • dockerfile-mode: Provides syntax highlighting and editing support for Dockerfile files.
  • jenkinsfile-mode: Provides syntax highlighting and editing support for Jenkinsfile.
  • groovy-mode: Provides major mode support for editing Groovy files.
  • yaml-mode: Provides major mode support for editing YAML files, complete with syntax highlighting and formatting commands.
  • ansible-doc: Provides documentation lookup for Ansible modules.
  • flymake-ansible-lint: Provides on-the-fly syntax checking for Ansible playbooks and roles, ensuring code quality.
  • flymake-bashate: Integrates bashate for syntax checking of Bash scripts in real-time within Emacs.

Category: Elisp

  • easy-escape: Simplifies the process of escaping Elisp characters in strings.
  • aggressive-indent: Automatically keeps your code indented as you type. The author mainly uses this package with Elisp.
  • erefactor: Assists in refactoring Elisp code.
  • elisp-autofmt: Automatically formats Emacs Lisp code.
  • paren-face: Visually enhances Elisp parentheses.
  • elisp-refs: Provides tools for managing and browsing references to Emacs Lisp functions and variables.
  • package-lint: Lints Emacs Lisp packages to ensure compliance with best practices and package standards.
  • page-break-lines: Highlights page break lines in the buffer, improving visual flow and navigation.
  • helpful: An improved help system for Emacs, providing better documentation lookup.

Category: File Manager

  • dired (built-in): File manager.
  • nerd-icons-dired: Enhances Dired mode with icons from Nerd Fonts, improving file browsing.
  • dired-hacks: Extends the functionality of dired.

Category: Other packages

  • expand-region: Expands the selected region in code, making it easier to select logical blocks of code or text.
  • disable-mouse: Disables mouse support within Emacs, encouraging keyboard-centric navigation and editing. This can be beneficial for some users who prefer a more traditional text editor experience.
  • sdcv: Bring the Stardict’s dictionary functionality directly into your Emacs workflow. This will turn Emacs into a dictionary.
  • fasd: Offers fast access to files and directories based on your history and usage patterns, optimizing file navigation.
  • dir-config: Automatically find and evaluate .dir-config.el Elisp files to configure directory-specific settings.
  • exec-path-from-shell: Ensures Emacs uses the same environment variables as your shell.
  • abbrev (built-in): Create abbreviations that expand into longer snippets of text.
  • jinx: Provides on-the-fly spell checking.
  • which-key (built-in): Displays available keybindings in a popup, helping users learn and remember key combinations in Emacs.
  • nerd-icons: Adds support for Nerd Fonts in Emacs, improving visual aesthetics in various modes.

By focusing on these essential packages that favor built-in Emacs functions, the Emacs configuration was simplified while still maintaining a highly functional setup.

And you, what Emacs packages are you using?

Leave a Reply

Your email address will not be published. Required fields are marked *