1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
# Emacs Configuration
Personal Emacs configuration focused on simplicity and modern tooling while respecting default Emacs keybindings.
## Philosophy
- Clean and minimal configuration
- Prefer built-in Emacs functionality when possible
- Use modern, actively maintained packages
- Respect default Emacs keybindings
- Single `init.el` file for simplicity
## Structure
```
~/.config/emacs/
├── init.el # Main configuration file
├── elisp/ # Custom configuration modules
│ ├── c-init.el # C/C++ configuration
│ └── hoersten-c-style.el # Custom C style
├── custom.el # Custom-set variables (gitignored)
└── README.md # This file
```
## Key Packages
### Completion Framework
- **vertico** - Vertical minibuffer completion UI
- **orderless** - Flexible completion style (space-separated patterns)
- **consult** - Enhanced commands (buffer switching, search, yank-pop)
- **marginalia** - Helpful annotations in completion candidates
- **embark** - Contextual actions on completion candidates
- **corfu** - In-buffer completion popup (manual trigger)
- **cape** - completion-at-point extensions (dabbrev, file paths)
### Development
- **eglot** - Built-in LSP client (Python, JS/TS, C/C++, YAML, JSON, CSS/SCSS, HTML, Haskell)
- **flymake** - Built-in syntax checking (enabled in all `prog-mode` buffers)
- **jinx** - Fast spell-checking globally enabled in `text-mode`, `prog-mode`, and `conf-mode` (skips code identifiers, only checks comments/strings in code)
- **treesit-auto** - Tree-sitter modes with automatic grammar installation
- **magit** - Git interface
- **forge** - GitHub/GitLab integration for magit
- **magit-todos** - Show TODO/FIXME comments in magit status
- **diff-hl** - Inline git diff indicators in fringe (synced with magit)
### Editing
- **paredit** - Structured editing for Lisp
- **expand-region** - Smart region expansion
- **move-text** - Move lines/regions up and down
- **visual-regexp** - Visual feedback for regexp replace
- **emmet-mode** - HTML/CSS abbreviation expansion
- **rainbow-delimiters** - Colorize nested delimiters
### Search & Navigation
- **avy** - Jump to visible text by typing target chars
- **rg** - ripgrep results buffer
- **wgrep** - Editable grep/rg results buffers
### Modes
- **markdown-mode** - Markdown editing
- **terraform-mode** - Terraform/HCL configuration
- **json-reformat** - JSON pretty-printing
- **ansible-doc** - Ansible module documentation lookup
- **jinja2-mode** - Jinja2 template syntax
- **haskell-mode** - Haskell editing
- Built-in `css-mode` handles `.scss` files (auto-upgraded to `css-ts-mode` via treesit-auto)
### UI
- **solarized-theme** - Color theme
- **auto-dark** - Switch theme with macOS dark mode
- **helpful** - Better Help buffers with source links
- **which-key** - Built-in popup of key completions
### Utilities
- **ibuffer-project** - Group buffers by project
- **exec-path-from-shell** - Import shell environment variables
- **ghostel** - libghostty terminal emulator
- **claude-code-context** - Send Emacs buffer context to Claude Code (loaded from `~/Dev/code/git/elisp/claude-code-context`)
## Key Bindings
### Custom Bindings
- `C-c b` - Browse URL at point
- `C-c c` - Compile
- `C-c r` - Recompile
- `C-c a` - Align regexp
- `C-c g` - Consult ripgrep (search with preview)
- `C-c s` - Launch eshell
- `C-c C-l` - claude-code-context prefix (`u` update, `d` diagnostics, `c` clear, `m` toggle mode)
- `C-x g` - Magit status
- `C-x C-b` - ibuffer (better buffer list)
- `C-=` - Expand region
- `C-:` - Avy jump (2 chars)
- `C-,` - Embark act (contextual actions)
- `C-.` - Embark dwim (default action)
- `M-p` / `M-n` - Move text up/down
- `M-/` - Completion at point (corfu)
### Enhanced Default Bindings
- `M-x` - Command execution (enhanced with vertico)
- `C-x b` / `C-x 4 b` / `C-x 5 b` - Switch buffer (enhanced with consult)
- `M-y` - Yank from kill ring (enhanced with consult)
- `C-h f` / `C-h v` / `C-h k` / `C-h x` - Help (enhanced with helpful)
## Installation
### Prerequisites
**macOS:**
```bash
brew install enchant pkg-config
```
**Ubuntu/Debian:**
```bash
sudo apt install libenchant-2-dev pkg-config
```
### Setup
1. Clone this repository to `~/.config/emacs`:
```bash
git clone [email protected]:lukehoersten/emacs.d.git ~/.config/emacs
```
2. Launch Emacs - packages will auto-install on first run
3. Jinx spell-checker will compile its native module on first launch (requires enchant)
4. Tree-sitter grammars install automatically on first use
## Tree-sitter Support
Tree-sitter provides faster, more accurate syntax highlighting and parsing. Enabled automatically via `treesit-auto` for JavaScript/TypeScript, JSON, Python, YAML, CSS, HTML, C/C++, and many more. Grammars install on first use.
## Customizations
Emacs customizations are redirected to `custom.el` (gitignored) to keep `init.el` clean.
## Updating Packages
```elisp
M-x package-refresh-contents
M-x package-update-all
```
## Notes
- Theme: Solarized, switches between light/dark with macOS dark mode (via `auto-dark`)
- Font: Inconsolata-12 (GUI only)
- Shell: eshell (launched automatically on startup)
- Server: emacs server starts automatically for `emacsclient`
- Whitespace cleanup on save enabled globally
- Line numbers and rainbow delimiters enabled in all `prog-mode` and `text-mode` buffers
- Auto-fill (line wrap at column 120) enabled in all `text-mode` buffers
|