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 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 general 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: Better minibuffer

  • vertico: minimalistic vertical completion UI. (EDIT: There is also built-in alternative to vertico: fido-vertical-mode, but the author prefers vertico because it provides more features.)
  • marginalia: Enhances the display of completion candidates in the minibuffer.
  • embark: Enhances minibuffer completion and interaction with various Emacs commands and actions.
  • consult: Provides intelligent search and navigation commands, powered by the Emacs completion function, completing-read.

Category: Software development (General)

  • apheleia: A package that runs code formatters asynchronously without moving the cursor. Apheleia supports formatting many languages. It formats code after saving, applying changes only if the buffer is unmodified, preventing latency and cursor jumps.
  • 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)
  • 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.
  • indent-bars: Provides indentation guide-bars.
  • dtrt-indent: Automatically adjusts indentation based on the surrounding context in code files, improving code readability.
  • stripspace: Ensures that Emacs removes trailing whitespace before saving a buffer. Ensure that the column is restored.
  • 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.
  • flymake (built-in): An on-the-fly syntax checking system that works well with eglot.
  • paren (built-in): Matching parenthesis highlighting. (Modes: show-paren-mode or show-paren-local-mode).
  • 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.
  • highlight-symbol: Highlight occurrences of symbols in your code. (The author is now using built-in functions to toggle symbol highlighting in Emacs )

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.
  • persist-text-scale: Provides persist-text-scale-mode, which ensures that all adjustments made with text-scale-increase and text-scale-decrease are persisted and restored across sessions. As a result, the text size in each buffer remains consistent, even after restarting Emacs.

Category: Themes

  • ef-themes: A collection of light and dark themes for GNU Emacs whose goal is to provide colorful themes.
  • modus-themes: Highly accessible themes for GNU Emacs, conforming with the highest standard for color contrast between background and foreground values.
  • doom-themes: An megapack of popular themes, including aesthetic extensions for popular packages (e.g., Tomorrow Night/Day, Solarized, Gruvbox…).
  • tomorrow-night-deepblue-theme: A blue color theme for Emacs inspired by the Tomorrow Night color scheme.

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-surround: Enhances text object handling in Evil mode, allowing for easier manipulation of surrounding characters.
  • vim-tab-bar: Provides a tab-bar interface reminiscent of Vim.
  • vdiff: Provides a visual interface for comparing two versions of a file that is similar to the Vim editor. (EDIT: The author is now uses the built-in ediff)
  • evil-snipe: Provides enhanced search and jump functionality for Evil mode. (EDIT: The author replaced this package with avy)

Category: Terminal Emulators

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

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.

Category: Elisp

  • aggressive-indent: Automatically keeps your code indented as you type. The author mainly uses this package with Elisp.
  • compile-angel: Speed up Emacs by ensuring all libraries are byte-compiled and native-compiled. Byte-compilation reduces the overhead of loading Emacs Lisp code at runtime, while native compilation optimizes performance by generating machine code specific to your system.
  • Paredit: A minor mode that enforces balanced parentheses while editing Lisp code. (In addition to Paredit, the author uses enhanced-evil-paredit.)

Category: File Manager

  • dired (built-in): File manager. (EDIT: The author is also using the built-in modes dired-hide-details-mode and dired-omit-mode.)
  • nerd-icons-dired: Enhances Dired mode with icons from Nerd Fonts, improving file browsing.

Category: Other packages

  • buffer-terminator: A package that automatically and safely kills buffers to help maintain a clean and efficient workspace, while also improving Emacs’ performance by reducing the number of open buffers, thereby decreasing the number of active modes, timers, and other processes associated with those buffers.
  • expand-region: Expands the selected region in code, making it easier to select logical blocks of code or text.
  • inhibit-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.
  • bufferfile: Delete or rename buffer file names with their associated buffers.
  • quick-fasd: Offers fast access to files and directories based on your history and usage patterns, optimizing file navigation.
  • diff-hl: Displays git diff information in the fringe of your Emacs window. (Alternative to diff-hl: git-gutter.)
  • wgrep: Allows for in-buffer editing of grep results, improving the usability of search results. (It can be used to modify the occurrences returned by the Embark package embark-export function.)
  • dir-config: Automatically find and evaluate .dir-config.el Elisp files to configure directory-specific settings.
  • which-key (built-in): Displays available keybindings in a popup, helping users learn and remember key combinations in Emacs.
  • quick-sdcv: Bring the Stardict’s dictionary functionality directly into your Emacs workflow. This will turn Emacs into a dictionary.
  • golden-ratio: Automatic resizing of Emacs windows to the golden ratio.
  • diminish: This package implements hiding or abbreviation of the mode line displays (lighters) of minor-modes.
  • 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.
  • project.el (built-in): A package for managing and navigating projects, providing utilities for project-based operations like searching, switching, and file management within defined project directories.
  • flyspell-mode (built-in): An interface for spell-checking text using external programs like ispell, aspell, or hunspell for checking and correcting spelling in buffers. (EDIT: The author replaced Jinx with Flyspell because Jinx was slowing down Emacs.)
  • org-bullets: Replace org-mode leading stars with UTF-8 bullets (EDIT: The author is now using the org-ibullets fork)
  • hl-todo: highlight TODO, FIXME… (Here is a simple function that can highlight codetags such as TODO or FIXME)

Category: Miscellaneous file types

  • 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.
  • 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. (Emacs also offers a built-in Flymake backend for ShellCheck.)
  • lua-mode: Provides major mode support for editing Lua files. (EDIT: The author is now using the built-in lua-ts-mode.)
  • php-mode: Provides major mode support for editing PHP files. (EDIT: The author is now using the built-in php-ts-mode.)
  • dockerfile-mode: Provides syntax highlighting and editing support for Dockerfile files. (EDIT: The author is now using the built-in dockerfile-ts-mode.)
  • yaml-mode: Provides major mode support for editing YAML files, complete with syntax highlighting and formatting commands. (EDIT: The author is now using the built-in yaml-ts-mode.)

By focusing on these packages, the Emacs configuration was simplified while still maintaining a highly functional setup.

Leave a Reply

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