emacs configuration

on this page
Emacs with modern configuration and AI integration

tl;dr

Install:

curl -fsSL https://raw.githubusercontent.com/mjbommar/mjbommar-emacs/master/install.sh | bash

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 session
  • C-c RET - send prompt to ai
  • C-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 text
  • M-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 line
  • M-a - accept entire suggestion (shift+meta+a)
  • M-n/M-p - cycle through suggestions
  • M-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 run
  • c-c c-c c-b - cargo build
  • c-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 project
  • M-s l - search lines in current buffer
  • M-s f - find files with preview
  • C-x b - enhanced buffer switching

lightning-fast code navigation:

avy - jump to anywhere

  • C-: - jump to character
  • C-' - jump to two characters
  • M-g f - jump to line
  • M-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 file
  • C-x C-s - save file
  • C-x C-w - save as
  • C-x k - kill buffer
  • C-x C-c - quit emacs

code navigation menu

press C-c c to open the code navigation hydra:

  • d - jump to definition
  • r - find references
  • n - rename symbol
  • a - code actions
  • f - format buffer
  • h - show documentation

window management

  • C-x 2 - split horizontally
  • C-x 3 - split vertically
  • C-x 1 - delete other windows
  • C-x 0 - delete current window
  • C-x o - switch window

project management

  • C-c p f - find file in project
  • C-c p p - switch project
  • C-c p c - compile project
  • C-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 lines
  • C-> - mark next occurrence
  • C-< - mark previous occurrence
  • C-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 emulator
  • M-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) or C-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

development workflow

ai integration

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

  1. install the configuration using the one-line installer
  2. set up system dependencies (fonts and language servers)
  3. configure ai api keys for full ai integration
  4. explore the keybindings with C-h help system and which-key
  5. customize to your workflow by modifying init.el
  6. contribute improvements back to the github repository

resources

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.

on this page