Modern Emacs Configuration
A minimalist, high-performance Emacs configuration built on top of the minimal-emacs.d foundation. It uses straight.el for package management and is designed to integrate seamlessly with **Nix** development environments.
**The “Jail” Architecture**: All plugins, backups, elpa, and save files are strictly isolated in ~/.emacs.d/var/. The root directory stays clean.
**High Performance**:
Garbage Collection tuning via early-init.el.
**Eglot Booster**: Uses a Rust binary to parse LSP JSON 10x faster.
**Nix Integration**:
envrc: Automatically loads direnv/nix-shell environments per buffer.
treesit-auto: Configured to work with shared libraries.
**Modern Navigation**: Full “Vertico Stack” (Vertico, Consult, Orderless, Marginalia, Embark).
**Development**:
**LSP**: Eglot (Built-in) + Corfu (Icons & Docs) + Flymake.
**Git**: Magit + Diff-hl (Gutter).
**Formatter**: Apheleia (Auto-formatting).
**Visuals**: Catppuccin Mocha theme, Doom Modeline, and Org Modern.
git clone git@github.com:LudovicoPiero/emacs-config.git ~ /.emacs.d
2. External Dependencies (Nix)
This configuration relies on external binaries provided by your Nix shell or system packages. Ensure the following are available in your $PATH:
**Core**: git, ripgrep, fd, cmake, libtool.
**LSP & Boost**: emacs-lsp-booster (Crucial for speed), basedpyright, nil, gopls, rust-analyzer, clangd.
**Formatters**: nixfmt, gofumpt, black, clang-format.
On the first run, straight.el will bootstrap itself and compile all packages. This may take a few minutes.
~/.emacs.d/
├── early-init.el # GUI suppression & GC tuning
├── init.el # Minimalist Core (James Cherti base)
├── pre-early-init.el # The "Jail" setup (Redirects vars to var/)
├── post-init.el # The actual Module Loader
├── lisp/
│ ├── init-pkg.el # Straight.el & General.el (Leader setup)
│ ├── init-core.el # Defaults, Crux, Vundo, Org, Multi-cursors
│ ├── init-ui.el # Theme (Catppuccin), Modeline, Zoom
│ ├── init-nav.el # Vertico, Consult, Embark, Project
│ ├── init-dev.el # LSP (Eglot), Treesitter, Magit, Terminal
│ └── init-keys.el # Evil setup & Global/Orphan keys
└── var/ # AUTOMATICALLY CREATED (The Jail)
├── elpa/ # Packages
├── straight/ # Packages
├── undo/ # Undo history
└── auto-save/ # Auto saves
The Leader key is set to SPC.
Key Command Description
SPC SPCexecute-extended-commandM-x Run command
SPC .find-fileQuick Find File
SPC TABmode-line-other-bufferQuick Last Buffer
SPC uvundoVisual Undo Tree
SPC /evil-commentary-lineToggle Comment
SPC q qsave-buffers-kill-termQuit Emacs
SPC q Rrestart-emacsRestart Emacs
📂 Files (SPC f) & Buffers (SPC b)
Key Command Description
SPC f ffind-fileOpen File
SPC f rconsult-recent-fileRecent Files
SPC f ssave-bufferSave
SPC f Dcrux-delete-file-and-bufferDelete current file
SPC f Rcrux-rename-file-and-bufferRename current file
SPC f y(lambda)Yank file path
SPC b bconsult-bufferSwitch Buffer
SPC b kkill-current-bufferKill Buffer
SPC b rrevert-bufferReload from disk
SPC b nnext-bufferNext Buffer
SPC b pprevious-bufferPrevious Buffer
🚀 Project Management (SPC p)
Powered by built-in project.el and consult.
Key Command Description
SPC p pproject-switch-projectSwitch Project
SPC p fproject-find-fileFind file in project
SPC p bconsult-project-bufferBuffer in project
SPC p sproject-find-regexpGrep / Search Text
SPC p rproject-query-replace-regexpRefactor (Replace text)
SPC p cproject-compileRun Compile (Make/Cargo)
SPC p tproject-shellOpen Shell in Root
SPC p kproject-kill-buffersKill all project buffers
Powered by **Eglot**.
Key Command Description
SPC c aeglot-code-actionsCode Actions (Fixes)
SPC c reglot-renameRename Symbol
SPC c deldocShow Documentation
SPC c fapheleia-format-buffFormat Buffer
SPC x xconsult-flymakeList Errors
Key Command Description
SPC g gmagit-statusMagit Status Window
SPC g bmagit-blameToggle Blame
SPC g fmagit-file-dispatchFile Actions
SPC g d~magit-diff-buffer-file~ Diff current buffer
Key Command Description
SPC s sconsult-lineSearch within buffer
SPC s pconsult-ripgrepSearch Project (Rg)
SPC s fconsult-findFind File (Recursive)
SPC s iconsult-imenuJump to Symbol
SPC s hconsult-historyCommand History
🖥️ Terminal & UI (SPC o, SPC t)
Key Command Description
SPC o tvterm-toggleToggle Terminal
SPC o TvtermFullscreen Terminal
SPC t tconsult-themeSwitch Theme
SPC t l~display-line-numbers~ Toggle Line Numbers
SPC t wtoggle-word-wrapToggle Word Wrap
🪟 Windows & Zoom (SPC w, SPC z)
Key Command Description
SPC w s~split-window-below~ Split Horizontal
SPC w v~split-window-right~ Split Vertical
SPC w ddelete-windowClose Window
SPC w mdelete-other-windMaximize Window
SPC w =balance-windowsBalance Sizes
SPC z +~text-scale-increase~ Zoom In
SPC z -~text-scale-decrease~ Zoom Out
SPC z 0text-scale-set 0Reset Zoom