A modern, modular Emacs configuration with evil-mode, version-locked packages, and AI assistant integration.
- Evil Mode: Vim emulation with extensive plugin support
- Version Locking: Reproducible package management with straight.el
- Modular Design: Clean separation of concerns across modules
- Modern Completion: Vertico + Corfu + Consult ecosystem
- LSP Support: Full IDE features with the built-in eglot client
- AI Integration: the Claude CLI hosted in Emacs via claude-term (ghostel)
- Beautiful UI: Catppuccin theme with Nano Modeline
- Org Mode: Enhanced with org-roam, org-modern, and org-appear
- Git Integration: Magit, diff-hl, and git-timemachine
- Emacs 29.1 or later (recommended)
- Git
- Ripgrep (for fast searching)
- Language servers for your programming languages (optional)
If you have an existing Emacs configuration, back it up first:
mv ~/.config/emacs ~/.config/emacs.backup
mv ~/.emacs.d ~/.emacs.d.backup # if you have one
mv ~/.emacs ~/.emacs.backup # if you have one~/.emacs.d matters even if you only intend to use the XDG path. Emacs
"prefer[s] the XDG location only if the .emacs.d location does not
exist" (startup.el), so a leftover ~/.emacs.d silently wins and
~/.config/emacs is never read.
This config lives at the XDG location, ~/.config/emacs:
git clone https://github.com/yourusername/edmacs.git ~/.config/emacsIf you keep the checkout elsewhere — this machine keeps it at
~/Projects/edmacs — symlink it instead:
ln -s ~/Projects/edmacs ~/.config/emacsEmacs 27+ honours XDG_CONFIG_HOME; if you set it, substitute
$XDG_CONFIG_HOME/emacs for ~/.config/emacs throughout.
Start Emacs. On first launch, straight.el will automatically:
- Download and install itself
- Install all configured packages
- Compile everything
This may take a few minutes. Be patient!
After the initial setup, run:
M-x nerd-icons-install-fonts
Then restart Emacs for icons to display properly.
Claude sessions launch the claude CLI, so install and authenticate it
once (see the Claude Code docs); Emacs inherits that login and needs no
API key of its own. Permission prompts are raised by the CLI itself, so an
Emacs-hosted session asks for exactly what a terminal session asks for.
This configuration automatically syncs environment variables from your shell to Emacs using exec-path-from-shell. This ensures that:
- PATH is correct - Emacs can find all your command-line tools
- Language tools work - Node, Python, Ruby, etc. use the right versions
- Environment variables are available - API keys, tool configurations, etc.
On macOS and Linux GUI environments, the configuration automatically:
- Runs your login shell (
bash -lorzsh -l) - Extracts environment variables:
PATH,MANPATH,ANTHROPIC_API_KEY, etc. - Sets them in Emacs
To sync additional environment variables, edit modules/core.el:
(setq exec-path-from-shell-variables
'("PATH"
"MANPATH"
"ANTHROPIC_API_KEY"
"YOUR_CUSTOM_VAR")) ; Add your variables hereIf you only use Emacs in the terminal (not GUI), you can disable this:
;; In modules/core.el, comment out or remove the exec-path-from-shell blockedmacs/
├── early-init.el # Performance optimizations
├── init.el # Main entry point
├── modules/ # Configuration modules
│ ├── core.el # Basic settings
│ ├── evil-config.el # Evil mode
│ ├── keybindings.el # General.el keybindings
│ ├── ui.el # Theme and appearance
│ ├── completion.el # Vertico, Corfu, Consult
│ ├── programming.el # eglot, flymake, Apheleia
│ ├── ai.el # AI assistant
│ ├── org-config.el # Org mode
│ ├── git.el # Magit and git tools
│ └── languages/ # Language-specific configs
│ └── clojure.el # Example: Clojure setup
├── straight/
│ └── versions/ # Package version lockfiles (committed)
└── README.md
This configuration uses SPC (spacebar) as the leader key in normal/visual mode, and C-SPC in insert/emacs mode.
| Key | Action |
|---|---|
SPC SPC |
M-x (execute command) |
SPC ff |
Find file |
SPC fr |
Recent files |
SPC bb |
Switch buffer |
SPC bd |
Kill buffer |
SPC gg |
Magit status |
SPC ss |
Search buffer |
SPC sp |
Search project (ripgrep) |
SPC pf |
Find file in project |
SPC an |
New Claude session |
SPC oa |
Org agenda |
SPC hf |
Describe function |
| Key | Action |
|---|---|
SPC f |
File menu |
SPC ff |
Find file |
SPC fs |
Save file |
SPC fd |
Open dired |
| Key | Action |
|---|---|
SPC b |
Buffer menu |
SPC bb |
Switch buffer |
SPC bd |
Kill buffer |
SPC bn/bp |
Next/previous buffer |
C-w is the window prefix, active in every evil state — including
insert state and inside a Claude terminal pane — so moving between windows
never means leaving insert first. It carries evil's own window map plus a
tmux-flavored layer; SPC w reaches the same commands under the same
letters.
| Key | Action |
|---|---|
C-w h/j/k/l |
Navigate windows |
C-w | / C-w - |
Split right / below |
C-w H/J/K/L |
Resize pane (left/down/up/right) |
C-w RET |
Promote pane to main |
C-w = |
Rebalance the center windows |
C-w x |
Close pane (keeps the buffer) |
C-w d |
Delete window, or demote from main |
C-w m |
Pop a buffer into main |
C-w [ / C-w ] |
Previous / next stack pane |
C-w < / C-w > |
Narrow / widen the stack column |
C-w S |
Toggle side windows |
SPC w |
Window menu (same commands, leader-driven) |
SPC ws |
Split below |
SPC wv |
Split right |
SPC wd |
Delete window |
C-h/j/k/l |
Navigate windows |
Deliberately shadowed, following tmux rather than vim: C-w - (was
decrease-height) and C-w H/J/K/L (were move-window-far-*) become split and
resize, C-w x (was exchange) closes the pane, and insert-state C-w
(delete-word-backward, and a terminal pane's own word-erase) gives up its key.
nano-modeline renders one :eval form and never consults
global-mode-string, so anything reporting through that channel is invisible
(this is why an LSP client's own modeline diagnostics segment shows
nothing). modules/ui.el's
"Modeline content" section adds what is missing and filters what is noise:
-
Name filtering.
edmacs-modeline-name-filtersis an alist of(REGEXP . REPLACEMENT)applied to the displayed buffer name only — the buffer keeps its real name, soswitch-to-bufferandclaude-term--parse-buffer-nameare unaffected. First match wins; a filter that would empty the name is ignored. Out of the box:Buffer Shown as *claude-term:edmacs:review*edmacs:review*magit-diff: edmacs*edmacs diff*helpful variable: tab-width*tab-width*cider-repl edmacs*edmacs repl -
Diagnostics.
edmacs-modeline-diagnosticsreads flymake directly and showsE3 W2in the stockerror/warningfaces. Silent — not zero — when flymake is off, still checking, or clean, so it costs no width normally. -
Terminal panes.
ghostel-modehas no line of its own upstream, so a Claude pane fell through to the default text line and showed a file buffer's furniture. It now gets>_ edmacs:reviewon the left and the working directory on the right — no read-write box, no cursor position.
Emacs is a plain app launch (Emacs.app from the Dock), not a daemon. It
starts its own server so emacsclient works while it is open, and
desktop-save-mode restores tabs and layout on the next launch.
| Key | Action |
|---|---|
SPC qq |
Close the frame; closing the last one quits Emacs. |
SPC qr |
Restart Emacs (restart-emacs); the session comes back. |
| Key | Action |
|---|---|
SPC g |
Git menu |
SPC gg |
Magit status |
SPC gc |
Commit |
SPC gp |
Push |
SPC gP |
Pull |
SPC gl |
Log |
The eglot verbs need a language server attached; the flymake ones work in any buffer flymake checks, server or no server.
| Key | Action |
|---|---|
SPC c |
Code menu |
SPC ca |
Code action |
SPC cr |
Rename |
SPC cf |
Format |
SPC cd |
Go to definition |
SPC cR |
Find references |
SPC ch |
Hover doc |
SPC cw |
Diagnostics (consult) |
SPC cW |
Project diagnostics |
SPC cxl |
List buffer diagnostics |
SPC cxn |
Next error |
SPC cxp |
Previous error |
Claude runs as the real interactive CLI inside a ghostel terminal buffer
(modules/claude-term.el), tracked by a session registry
(modules/claude-term-registry.el).
Session panes are ordinary windows, not side windows, so C-w =
rebalances them along with everything else, other-window cycles through
them, and delete-other-windows closes them — the session keeps running
either way, since only the window goes.
| Key | Action |
|---|---|
SPC a |
Claude menu |
SPC an |
New session |
SPC aj |
Jump to session |
SPC aL |
List sessions |
SPC aw |
Toggle session pane |
SPC aA |
Show all sessions |
SPC ax |
Kill session |
SPC aX |
Kill all sessions |
SPC ar |
Rename session |
This configuration uses straight.el for reproducible package management with version locking.
Update a single package:
M-x straight-pull-package RET package-name RET
Update all packages:
M-x straight-pull-all
Lock current versions:
After updating and testing, lock the versions:
M-x straight-freeze-versions
This creates/updates straight/versions/default.el with current package commits.
Commit the lockfile:
git add straight/versions/
git commit -m "Update package versions"If you need to restore packages to locked versions:
M-x straight-thaw-versions
- Add a
use-packagedeclaration in the appropriate module file - Restart Emacs or evaluate the declaration
- Test the package
- Lock versions with
M-x straight-freeze-versions - Commit the updated lockfile
Language-specific configurations are in modules/languages/.
- Create
modules/languages/LANGUAGE.el - Configure packages, the language server, formatters, etc.
- The file will be loaded automatically when opening files of that type
Example structure:
;;; python.el --- Python configuration -*- lexical-binding: t -*-
(use-package python-mode
:mode "\\.py\\'"
:hook (python-mode . eglot-ensure))
(use-package poetry
:hook (python-mode . poetry-tracking-mode))- Clojure (example in
modules/languages/clojure.el)
Create a custom.el file in ~/.config/emacs/ for personal customizations
(init.el sets custom-file from user-emacs-directory, so this follows
the config wherever it lives):
;;; custom.el --- Personal customizations
;; Your personal settings here
(setq user-full-name "Your Name"
user-mail-address "your@email.com")This file is gitignored and won't be overwritten.
To disable a module, comment out its load line in init.el:
;; (load-module "ai") ; Disable AI assistantEdit modules/ui.el to change the font. The configuration tries several fonts in order of preference.
edmacs uses modus-themes (bundled with Emacs since 28, so no package
install is required). To change the variant, edit modules/ui.el:
(load-theme 'modus-vivendi :no-confirm) ; dark (default)
;; (load-theme 'modus-operandi :no-confirm) ; lightmodus-themes and its sibling ef-themes both apply fixed-pitch inheritance
correctly across markdown, org, and 50+ other faces, so proportional
prose (see variable-pitch-mode in modules/ai.el) keeps code, tables,
and indentation monospaced without any extra per-face patching.
- Check startup time:
M-x emacs-init-time - Profile startup: Install and run
esuppackage - Disable unused modules
- Rebuild a package:
M-x straight-rebuild-package - Rebuild all:
M-x straight-rebuild-all - Check for errors:
M-x straight-check-all
Run M-x nerd-icons-install-fonts and restart Emacs.
- Install the language server for your language
- Check the exchange:
M-x eglot-events-buffer - Restart the server:
M-x eglot-reconnect
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This configuration is licensed under the GNU General Public License v3.0 or later. See the LICENSE file for details.
This configuration is built on the shoulders of giants. Thanks to all the Emacs package maintainers and the community!