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
andearly-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: 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.
highlight-symbol: Highlight occurrences of symbols in your code.
(The author is now using the built-in alternative: The(highlight-symbol-at-point)
function to highlight and(unhighlight-regexp (regexp-quote (thing-at-point 'symbol t)))
to unhighlight.)- 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)
- 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.)
- git-modes: A collection of major and minor modes for various Git-related files.
Category: Better minibuffer
- consult: Provides intelligent search and navigation commands, powered by the Emacs completion function, completing-read.
- consult-dir: insert paths into minibuffer prompts in Emacs. Similar to fasd.
- vertico: minimalistic vertical completion UI. (There is also built-in alternative to vertico: fido-vertical-mode)
- marginalia: Enhances the display of completion candidates in the minibuffer.
- embark: Enhances minibuffer completion and interaction with various Emacs commands and actions.
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.
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.
Category: Elisp
- easy-escape: Improve readability of escape characters.
- aggressive-indent: Automatically keeps your code indented as you type. The author mainly uses this package with Elisp.
- paren-face: Visually enhances Elisp parentheses.
- package-lint: Lints Emacs Lisp packages to ensure compliance with best practices and package standards.
- helpful: An improved help system for Emacs.
- Paredit: A minor mode that enforces balanced parentheses while editing Lisp code. (In addition to paredit, the author uses modern-evil-paredit.)
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. (The author primarily uses it to hide or show hidden files and Git-ignored files.)
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.(An alternative that is simpler and more efficient for disabling the mouse: inhibit-mouse.el)- 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.
- visual-fill-column: A package that allows wrapping lines at a specified fill-column width.
sdcv: Bring the Stardict’s dictionary functionality directly into your Emacs workflow. This will turn Emacs into a dictionary.(EDIT: The author is now using quick-sdcv.el)- 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.
- 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.) - flyspell-mode (built-in): An interface for spell-checking text using external programs like
ispell
,aspell
, orhunspell
for checking and correcting spelling in buffers. (EDIT: I replaced Jinx with Flyspell because Jinx was slowing down Emacs.) - which-key (built-in): Displays available keybindings in a popup, helping users learn and remember key combinations in Emacs.
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.
- 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.
- 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.
- yaml-mode: Provides major mode support for editing YAML files, complete with syntax highlighting and formatting commands. (Can be replaced with its tree-sitter equivalent: yaml-ts-mode.)
- 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. (Emacs also offers a built-in Flymake backend for ShellCheck.)
By focusing on these packages, the Emacs configuration was simplified while still maintaining a highly functional setup.
And you, what Emacs packages are you using?