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 LSP-mode
- AI Integration: Claude AI assistant via claude-repl
- 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 ~/.emacs.d ~/.emacs.d.backup
mv ~/.emacs ~/.emacs.backup # if you have onegit clone https://github.com/yourusername/edmacs.git ~/.emacs.dStart 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.
To use the Claude AI assistant, set your API key:
export ANTHROPIC_API_KEY="your-api-key-here"Add this to your ~/.bashrc, ~/.zshrc, or equivalent.
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 # LSP, Flycheck, 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 aa |
AI chat |
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 |
| Key | Action |
|---|---|
SPC w |
Window menu |
SPC ws |
Split below |
SPC wv |
Split right |
SPC wd |
Delete window |
C-h/j/k/l |
Navigate windows |
| Key | Action |
|---|---|
SPC g |
Git menu |
SPC gg |
Magit status |
SPC gc |
Commit |
SPC gp |
Push |
SPC gP |
Pull |
SPC gl |
Log |
When in an LSP-enabled buffer:
| 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 |
| Key | Action |
|---|---|
SPC a |
AI menu |
SPC aa |
Chat with Claude |
SPC ae |
Explain code |
SPC ar |
Refactor |
SPC ad |
Document |
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, LSP, 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 . lsp-deferred))
(use-package poetry
:hook (python-mode . poetry-tracking-mode))- Clojure (example in
modules/languages/clojure.el)
Create a custom.el file in ~/.emacs.d/ for personal customizations:
;;; 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.
To change the theme, edit modules/ui.el:
(setq catppuccin-flavor 'mocha) ; Options: latte, frappe, macchiato, mochaOr use a different theme entirely by replacing the catppuccin-theme use-package block.
- 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 LSP status:
M-x lsp-describe-session - Restart LSP:
M-x lsp-workspace-restart
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!