An enhanced Emacs configuration for modern Clojure SaaS development with AI integration, forked from magnars/emacsd-reboot.
Original Philosophy: A personal Emacs configuration as seen on emacsrocks.com and parens-of-the-dead.com, optimized for Norwegian keyboard on OSX.
This Fork: Extends the original foundation with AI-enhanced workflows, development process management, and modern SaaS tooling while preserving the personal, pragmatic approach.
Download Emacs for Mac OSX.
# Backup your existing configuration
mv ~/.emacs.d ~/.emacs.d.backup
# Clone this enhanced fork
git clone <your-fork-url> ~/.emacs.d
# Start Emacs
emacsFor AI features, create ~/.emacs.d/private.el:
(setq my/secret-openai-key "your-openai-key"
my/secret-anthropic-key "your-anthropic-key"
my/secret-google-gemini-api-key "your-gemini-key"
my/secret-deepseek-api-key "your-deepseek-key")-
Spell checking:
brew install aspell --lang=en -
Static analysis for Clojure with LSP:
brew install clojure-lsp/brew/clojure-lsp-native -
Fast grepping:
brew install ripgrep -
Make dired happy, install
glsas replacement forls:brew install xz coreutils -
Stop clojure-lsp from adding duplicate namespace declarations: Open
~/.config/clojure-lsp/config.ednand add:{:auto-add-ns-to-new-files? false} -
Add dependencies to the project without CIDER running:
brew install babashka/brew/neil -
Static analysis for CSS with LSP:
npm install -g vscode-langservers-extracted -
On a Mac you might want to do this, to disable
C-M-din your OS:defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 70 '<dict><key>enabled</key><false/></dict>'
-
Datomic Pro (for ShipClojure-Datom development):
# Download from https://my.datomic.com/downloads/pro # Extract and add to PATH
-
Node.js and npm (for Shadow-CLJS and CSS builds):
brew install node
-
AI Integration Dependencies:
# For MCP filesystem server npm install -g @modelcontextprotocol/server-filesystem # For MCP fetch server pip install mcp-server-fetch # or with uvx: uvx mcp-server-fetch
If you want to use my settings straight out of the box, here are some things to note:
-
This is my personal emacs configuration. I am constantly tuning it to my preferences. You should consider doing the same. Maybe start with a blank emacs + Technomancy's better-defaults package, and then dig through this repo for useful nuggets, instead of forking it directly.
-
The key bindings are optimized for a norwegian keyboard layout.
-
You quit emacs with
C-x r q, mnemonic Really Quit. -
Find file in project with
C-x p f, in dir withC-x C-f, recent withC-x f -
Switch to a project with
C-x p p -
Add your user- and project-specific stuff in .emacs.d/users/[machine name]/*.el
-
C-his rebound to backspace, like in the shell. Get help onF1instead. -
Autocomplete with
C-,orC-., try both to get a feel for them. (autocomplete entire lines withC-:) -
expand-region is your friend. Find its bound key by doing
F1 f er/expand-region -
Undo with
C-_and redo withM-_. Watch the undo-tree withC-x u -
Indent and clean up white space in the entire buffer with
C-c n -
On a mac, the Meta key
Mis bound to Command. -
I recommend rebinding Caps Lock to Ctrl and use that instead of the often badly placed Ctrl-key.
-
Watch emacsrocks.com
- AI assistance:
C-c RETto send context to AI,C-c C-RETfor provider menu - Process management:
C-c C-x C-pto manage development services (Datomic, Shadow-CLJS, etc.) - Continuous window resize:
C-x }then keep pressing}to continuously enlarge windows - Enhanced buffer operations:
C-x C-rto rename file and buffer,C-x C-kto delete file - Auto-testing: Tests run automatically when you save Clojure files
- Smart yanking: Pasted code auto-indents in programming modes
- Multi-provider support: OpenAI, Anthropic Claude, Google Gemini, DeepSeek
- Project-aware prompts: AI has context about your codebase and technologies
- Expert knowledge base: Specialized prompts for Clojure, re-frame, Malli, etc.
- Tool access: AI can read project files via Model Context Protocol (MCP)
- Service orchestration: Manage Datomic transactor, Shadow-CLJS watch, CSS builds
- Project isolation: Services tagged and grouped by project
- One-click startup: Start your entire development stack from Emacs
- Kaocha integration: Run tests with
C-c k t/r/a - Auto-execution: Tests run when you save files
- Smart discovery: Automatically finds and runs relevant tests
- Repeat mode: Window resize operations can be repeated continuously
- Smart popups: Better REPL and help buffer management
- Layout preservation: Window configurations restored after operations
- Smart yanking: Auto-indent when pasting in programming modes
- Enhanced file ops: Rename, delete, copy paths, touch files
- Scratch buffers: Create multiple scratch buffers with smart naming
When you start using emacs for the first time, your habits fight you every inch of the way. Your fingers long for the good old familiar keybindings. Here's an overview of the most commonly used shortcuts to get you through this pain:
CShorthand for the ctrl-keyMShorthand for the meta-key (bound to command on my mac settings)SShorthand for the shift-keysShorthand for the super-key (bound to option on my mac settings)
C-x C-fOpen a file. Starts in the current directoryC-x fOpen a recently visited fileC-x p fOpen a file in the current project (based on .git ++)C-x C-sSave this fileC-x C-wSave as ...C-x C-jJump to this files' current directoryC-x bSwitch to another open file (buffer)C-x C-bList all open files (buffers)
C-x C-rRename current file and bufferC-x C-kDelete current file and kill bufferC-x M-wCopy current file path to clipboardC-x tTouch file (save without changes)C-c bCreate new scratch buffer
C-spaceStart marking stuff. C-g to cancel.C-wCut (aka kill)C-kCut till end of lineM-wCopyC-yPaste (aka yank) - auto-indents in programming modes (fork)M-yCycle last paste through previous killsC-x C-yChoose what to paste from previous killsC-@Mark stuff quickly. Press multiple timesC-S-yPaste without auto-indenting (fork)
C-gQuit out of whatever mess you've gotten yourself intoM-xRun a command by nameC-.AutocompleteC-_UndoM-_RedoC-x uShow the undo-treeC-x mOpen magit. It's a magical git interface for emacs
C-c RETSend to AI with project contextC-c C-RETAI provider menuC-c C-x C-pOpen process manager (Prodigy)
C-arrowMove past words/paragraphsC-aGo to start of lineC-eGo to end of lineM-g M-gGo to line numberC-x C-iGo to symbolC-sSearch forward. PressC-sagain to go further.C-rSearch backward. PressC-ragain to go further.
C-x 0Close this windowC-x 1Close other windowsC-x 2Split window horizontallyC-x 3Split window verticallyS-arrowJump to window to the left/right/up/down
C-x }Enlarge window horizontally, then}}}...to keep enlargingC-x {Shrink window horizontally, then{{{...to keep shrinkingC-x ^Enlarge window vertically, then^^^...to keep enlargingC-` Toggle popup buffers (REPLs, help, etc.)
C-c k tRun test at pointC-c k rRun namespace testsC-c k aRun all testsC-c k wShow test warningsC-c k hHide test windows
F1 tBasic tutorialF1 kHelp for a keybindingF1 rEmacs' extensive documentation
| Area | Original | This Fork |
|---|---|---|
| AI Integration | None | Multi-provider LLM with project context |
| Process Management | Manual external processes | Integrated Prodigy service management |
| Testing | Manual CIDER evaluation | Automated Kaocha with file-load hooks |
| Window Management | Basic operations | Repeat-mode for continuous operations |
| Buffer Operations | Basic file handling | Enhanced file manipulation utilities |
| Package Management | use-package only | Hybrid: use-package + straight.el |
| Development Stack | Generic Clojure | SaaS-optimized (Datomic, Shadow-CLJS) |
| Editing | Standard yank | Smart auto-indent on paste |
~/.emacs.d/
βββ init.el # Main entry point (enhanced)
βββ custom.el # Emacs custom settings
βββ private.el # AI API keys (create this)
βββ settings/ # Core functionality
β βββ buffers.el # Enhanced buffer operations (new)
β βββ windows.el # Window management with repeat-mode (enhanced)
β βββ indented-yank.el # Smart paste functionality (new)
β βββ work.el # Project-specific config (new)
β βββ ... # Original settings (enhanced)
βββ packages/ # Package configurations
β βββ setup-gptel.el # AI integration (new)
β βββ setup-prodigy.el # Process management (new)
β βββ setup-kaocha-runner.el # Test automation (new)
β βββ ... # Original + enhanced packages
βββ ai-prompts/ # AI expertise definitions (new)
βββ clojure-expert.md # Clojure development context
βββ re-frame-expert.md # State management patterns
βββ ... # Other expert contexts
- Original Foundation: Magnar Sveen for the excellent emacsd-reboot
- AI Integration: Built on karthink/gptel
- Process Management: rejeep/prodigy.el
- Enhanced Tooling: Various package authors in the Emacs and Clojure communities
This configuration maintains the personal, pragmatic philosophy of the original emacsd-reboot while extending it for modern AI-enhanced Clojure SaaS development workflows.