emacs configuration
on this page

tl;dr
Install: |
|
AI Integration: | GPTel chat + Minuet inline completion with Claude Opus 4.1 |
Development: | Full LSP for Python & Rust with formatting and error checking |
Theme: | Doom One with automatic light/dark switching (C-c T) |
Performance: | < 0.5s startup, lazy loading, optimized garbage collection |
a modern, ai-integrated emacs configuration that transforms the classic editor into a powerful development environment for python and rust with cutting-edge ai features.
overview
this configuration provides a complete emacs setup that combines the timeless power of emacs with modern development tools and ai integration. it’s designed for developers who want:
- ai-powered coding with claude opus 4.1 for chat and inline completion
- modern aesthetics with doom one theme and jetbrains mono font
- python development with full lsp support, virtual environments, and formatting
- rust development with rust-analyzer and cargo integration
- lightning-fast performance with optimized startup and lazy loading
- intuitive interface with modern completion and discovery features
get started with the one-line installer or explore the features below.
quick start
one-line installer
the fastest way to get started:
curl -fsSL https://raw.githubusercontent.com/mjbommar/mjbommar-emacs/master/install.sh | bash
this will:
- automatically back up your existing emacs configuration
- download and install to
~/.emacs.d
- handle all dependencies and package installation
skip prompts installation
for automated setups:
curl -fsSL https://raw.githubusercontent.com/mjbommar/mjbommar-emacs/master/install.sh | bash -s -- --yes
manual installation
if you prefer manual control:
# backup existing config
mv ~/.emacs.d ~/.emacs.d.backup
# clone and install
git clone https://github.com/mjbommar/mjbommar-emacs.git /tmp/mjbommar-emacs
mkdir -p ~/.emacs.d
cp -r /tmp/mjbommar-emacs/* ~/.emacs.d/
rm -rf ~/.emacs.d/.git
system dependencies
fonts
required fonts for optimal appearance:
# ubuntu/debian
sudo apt install fonts-jetbrains-mono fonts-noto
# macos with homebrew
brew tap homebrew/cask-fonts
brew install --cask font-jetbrains-mono font-noto-sans
language servers
for full development features:
# python lsp server (choose one)
pip install pyright
# or use uv for modern python tooling
uv tool install ruff
# rust analyzer
rustup component add rust-analyzer
# vterm dependencies (ubuntu/debian)
sudo apt install cmake libtool-bin libvterm-dev
# vterm dependencies (macos)
brew install cmake
ai integration
claude opus 4.1 integration
this configuration features state-of-the-art ai integration using anthropic’s claude opus 4.1:
gptel - conversational ai
C-c g
- start new chat sessionC-c RET
- send prompt to aiC-c c-RET
- open gptel configuration menu- stream responses in real-time
- persistent chat sessions
minuet - inline code completion
M-i
- show ai suggestion as ghost textM-y
- complete with minibuffer (multiple suggestions)c-c m
- configure ai provider- automatic suggestions after 0.5s idle time
- context-aware completions
ai setup
configure your api keys:
# environment variables
export ANTHROPIC_API_KEY='sk-ant-...'
export OPENAI_API_KEY='sk-...' # optional fallback
or create ~/.authinfo
:
machine api.anthropic.com login apikey password your_anthropic_key
machine api.openai.com login apikey password your_openai_key
ai keybindings
when ai suggestions are active:
M-a
- accept current lineM-a
- accept entire suggestion (shift+meta+a)M-n/M-p
- cycle through suggestionsM-e
- dismiss suggestion
development features
python development
comprehensive python support with modern tooling:
lsp integration
- full lsp support via eglot
- syntax checking with flymake
- intelligent code navigation
- hover documentation
- symbol references
formatting & linting
- black formatting on save
- ruff integration for fast linting
- automatic import organization
- pep 8 compliance checking
virtual environment management
- pyvenv integration
- automatic environment detection
- conda environment support
- environment switching from within emacs
rust development
complete rust development environment:
rust-analyzer integration
- intelligent code completion
- error checking with flycheck
- cargo integration
- automatic formatting with rustfmt
cargo commands
c-c c-c c-r
- cargo runc-c c-c c-b
- cargo buildc-c c-c c-t
- cargo test- integrated test output and error navigation
file format support
extensive support for modern file formats:
- markdown - live preview, github flavor, table editing
- json - syntax highlighting, formatting, lsp support
- yaml - full support with validation
- toml - cargo.toml, pyproject.toml support
- csv - table viewing and editing with csv-mode
aesthetics & interface
doom one theme
beautiful, carefully crafted theme with excellent contrast:
;; toggle between dark and light themes
c-c t ; switch themes dynamically
- doom-one (dark) - default theme with excellent syntax highlighting
- doom-one-light - clean light theme for bright environments
- automatic theme persistence across sessions
- optimized for long coding sessions
jetbrains mono font
professional monospace font with programming ligatures:
- enhanced readability with proper letter spacing
- programming ligatures (=>, !=, -> automatically rendered)
- consistent appearance across all operating systems
- optimal for code display at various sizes
modern ui elements
clean, distraction-free interface:
- relative line numbers for easy navigation
- subtle mode line with essential information
- no menu bar, tool bar, or scroll bars
- focused on content with minimal chrome
productivity features
vertico & consult
modern completion and search framework:
vertico completion
- fast, incremental completion in minibuffer
- preview functionality for files and buffers
- integration with all emacs commands
- consistent interface across all contexts
consult commands
M-s r
- ripgrep search in projectM-s l
- search lines in current bufferM-s f
- find files with previewC-x b
- enhanced buffer switching
navigation & movement
lightning-fast code navigation:
avy - jump to anywhere
C-:
- jump to characterC-'
- jump to two charactersM-g f
- jump to lineM-g w
- jump to word
code navigation hydra
C-c c
- open code navigation menu- visual interface for all navigation commands
- consistent bindings across programming modes
version control with magit
industry-standard git integration:
C-x g
- open magit status- full git workflow from within emacs
- stage, commit, push, pull operations
- branch management and merge conflict resolution
- integrated with project and file management
essential keybindings
file operations
C-x C-f
- find/open fileC-x C-s
- save fileC-x C-w
- save asC-x k
- kill bufferC-x C-c
- quit emacs
code navigation menu
press C-c c
to open the code navigation hydra:
d
- jump to definitionr
- find referencesn
- rename symbola
- code actionsf
- format bufferh
- show documentation
window management
C-x 2
- split horizontallyC-x 3
- split verticallyC-x 1
- delete other windowsC-x 0
- delete current windowC-x o
- switch window
project management
C-c p f
- find file in projectC-c p p
- switch projectC-c p c
- compile projectC-c p s
- search in project
advanced features
treemacs file explorer
modern file tree sidebar:
C-x t t
- toggle treemacs- git integration with status indicators
- project-aware file navigation
- bookmark support for quick access
multiple cursors
edit multiple locations simultaneously:
C-s-c C-s-c
- edit linesC->
- mark next occurrenceC-<
- mark previous occurrenceC-c C-<
- mark all occurrences
yasnippet templates
code templates and snippets:
- intelligent snippet expansion
- context-aware templates
- custom snippet creation
- integration with completion systems
terminal integration
full terminal emulation within emacs:
M-x vterm
- full terminal emulatorM-x eshell
- elisp shell- integration with system shell
- persistent terminal sessions
performance optimization
startup performance
optimized for fast startup:
- < 0.5 seconds typical startup time
- lazy loading for most packages
- optimized garbage collection settings
- deferred package initialization
memory management
efficient resource usage:
- no-littering for clean directory structure
- automatic cleanup of temporary files
- optimized buffer management
- minimal memory footprint
native compilation
leverages emacs 28+ native compilation:
- automatically compiles packages to native code
- significant performance improvements
- transparent background compilation
- maintains compatibility with older emacs versions
customization
theme switching
easily switch between dark and light themes:
;; toggle theme
(global-set-key (kbd "C-c t") 'my/toggle-theme)
font configuration
customize fonts and sizes:
;; adjust font size
(defvar my/font-size 120) ; default: 120 (12pt)
;; change font family
(defvar my/default-font "jetbrains mono")
ai model configuration
customize ai providers:
- default: claude opus 4.1 (claude-opus-4-1-20250805)
- fallback: openai gpt models
- local: ollama support for privacy
- configure via
C-c m
(minuet) orC-c C-ret
(gptel)
adding packages
extend functionality with use-package:
(use-package your-package
:ensure t
:bind ("C-c y" . your-command)
:config
;; configuration here
)
troubleshooting
slow startup
check startup performance:
;; check startup time in *messages* buffer
;; look for gc count and timing information
common solutions:
- ensure native compilation is enabled
- check for problematic packages in init sequence
- verify system dependencies are installed
lsp not working
verify language servers are installed:
# check python
which pyright
# check rust
which rust-analyzer
# check if servers are in path
echo $path
fonts not displaying
ensure fonts are system-wide available:
# linux - check font installation
fC-list | grep -i jetbrains
# macos - check font book
# windows - check fonts control panel
ai features not responding
verify api key configuration:
# check environment variables
echo $ANTHROPIC_API_KEY
# check .authinfo file permissions and format
cat ~/.authinfo
chmod 600 ~/.authinfo
learning resources
emacs fundamentals
- emacs tutorial - built-in tutorial (
C-h t
) - mastering emacs - comprehensive guide
- emacs wiki - community knowledge base
development workflow
- magit user manual - git integration
- eglot manual - lsp integration
- org mode guide - note-taking and planning
ai integration
- gptel documentation - chat interface
- minuet documentation - inline completion
- anthropic api docs - claude api reference
configuration files
the configuration consists of key files:
~/.emacs.d/
├── init.el # main configuration
├── early-init.el # early startup optimizations
├── readme.md # documentation
├── keyboard.md # comprehensive keybinding reference
├── etc/ # no-littering config files
├── var/ # no-littering data files
└── elpa/ # installed packages
key configuration highlights
- performance: optimized gc settings and lazy loading
- ui: doom themes, jetbrains mono, clean interface
- completion: vertico, consult, corfu for modern completion
- development: eglot lsp, project management, version control
- ai integration: gptel and minuet with claude opus 4.1
next steps
- install the configuration using the one-line installer
- set up system dependencies (fonts and language servers)
- configure ai api keys for full ai integration
- explore the keybindings with
C-h
help system and which-key - customize to your workflow by modifying init.el
- contribute improvements back to the github repository
resources
- github repository - source code and issues
- keyboard shortcuts reference - complete keybinding guide
- installation script - automated setup
- anthropic claude - ai integration provider
- emacs community - discussions and help
transform your development workflow with this modern emacs configuration that brings together the best of traditional emacs power with cutting-edge ai assistance and contemporary development practices.