aeuaeo
This commit is contained in:
+38
-33
@@ -59,22 +59,24 @@ Your Doom Emacs now has a comprehensive gptel setup with:
|
||||
|
||||
## ⌨️ Keybindings Reference
|
||||
|
||||
All gptel commands are under `SPC a` (AI prefix):
|
||||
All gptel commands are under `SPC A` (uppercase A - AI prefix):
|
||||
|
||||
| Keybinding | Command | Description |
|
||||
|------------|---------|-------------|
|
||||
| `SPC a g` | `gptel` | Open gptel chat buffer |
|
||||
| `SPC a s` | `gptel-send` | Send prompt to LLM |
|
||||
| `SPC a m` | `gptel-menu` | Open transient menu (change model, backend, etc) |
|
||||
| `SPC a r` | `gptel-rewrite` | Rewrite selected region with AI |
|
||||
| `SPC a c` | `gptel-add` | Add region/buffer to context |
|
||||
| `SPC a f` | `gptel-add-file` | Add file to context |
|
||||
| `SPC a q` | `gptel-quick` | Quick lookup in popup (word/region) |
|
||||
| `SPC a l` | Load buffer into session | Send whole buffer as context |
|
||||
| `SPC a b` | Send whole buffer | Send entire buffer to AI |
|
||||
| `SPC a R` | Refactor region | Refactor selected code |
|
||||
| `SPC a e` | Quick explain | Explain selected code quickly |
|
||||
| `SPC a p` | Proofread text | Fix grammar/spelling in selection |
|
||||
| `SPC A g` | `gptel` | Open gptel chat buffer |
|
||||
| `SPC A s` | `gptel-send` | Send prompt to LLM |
|
||||
| `SPC A m` | `gptel-menu` | Open transient menu (change model, backend, etc) |
|
||||
| `SPC A r` | `gptel-rewrite` | Rewrite selected region with AI |
|
||||
| `SPC A c` | `gptel-add` | Add region/buffer to context |
|
||||
| `SPC A f` | `gptel-add-file` | Add file to context |
|
||||
| `SPC A q` | `gptel-quick` | Quick lookup in popup (word/region) |
|
||||
| `SPC A l` | Load buffer into session | Send whole buffer as context |
|
||||
| `SPC A b` | Send whole buffer | Send entire buffer to AI |
|
||||
| `SPC A R` | Refactor region | Refactor selected code |
|
||||
| `SPC A e` | Quick explain | Explain selected code quickly |
|
||||
| `SPC A p` | Proofread text | Fix grammar/spelling in selection |
|
||||
| `SPC A C` | Complete at point | Trigger AI code completion |
|
||||
| `SPC A a` | Accept completion | Accept displayed ghost text completion |
|
||||
|
||||
### In gptel buffer:
|
||||
- `C-c RET` - Send message
|
||||
@@ -82,7 +84,8 @@ All gptel commands are under `SPC a` (AI prefix):
|
||||
- `C-c C-k` - Abort request
|
||||
|
||||
### Auto-completion (in programming modes):
|
||||
- `M-TAB` or `C-c TAB` - Trigger completion
|
||||
- `M-TAB` or `C-c TAB` - Trigger completion (`gptel-complete`)
|
||||
- `C-c C-a` - Accept completion (`gptel-accept-completion`)
|
||||
|
||||
---
|
||||
|
||||
@@ -90,7 +93,7 @@ All gptel commands are under `SPC a` (AI prefix):
|
||||
|
||||
Presets let you switch AI behavior for specific tasks:
|
||||
|
||||
1. Open gptel menu: `SPC a m` or `C-c C-c`
|
||||
1. Open gptel menu: `SPC A m` or `C-c C-c`
|
||||
2. Select "Preset" option
|
||||
3. Choose from:
|
||||
- **coder** - Expert coding assistant (uses Claude Sonnet 4.5)
|
||||
@@ -99,7 +102,7 @@ Presets let you switch AI behavior for specific tasks:
|
||||
- **quick** - Quick, concise answers (uses fast Gemini Flash)
|
||||
- **docs** - Documentation writer
|
||||
|
||||
Or use `C-u SPC a s` to adjust settings on-the-fly!
|
||||
Or use `C-u SPC A s` to adjust settings on-the-fly!
|
||||
|
||||
---
|
||||
|
||||
@@ -107,15 +110,15 @@ Or use `C-u SPC a s` to adjust settings on-the-fly!
|
||||
|
||||
### 1. Chat with AI
|
||||
```
|
||||
SPC a g → Opens gptel buffer
|
||||
SPC A g → Opens gptel buffer
|
||||
Type question → Write your prompt
|
||||
C-c RET → Send (or SPC a s)
|
||||
C-c RET → Send (or SPC A s)
|
||||
```
|
||||
|
||||
### 2. Rewrite Code
|
||||
```
|
||||
1. Select code region (visual mode)
|
||||
2. SPC a r
|
||||
2. SPC A r
|
||||
3. Type instruction: "Add error handling"
|
||||
4. Review changes and accept
|
||||
```
|
||||
@@ -123,23 +126,23 @@ C-c RET → Send (or SPC a s)
|
||||
### 3. Add Context (Multi-file awareness)
|
||||
```
|
||||
1. Open reference file
|
||||
2. SPC a c (adds buffer to context)
|
||||
3. Open gptel: SPC a g
|
||||
2. SPC A c (adds buffer to context)
|
||||
3. Open gptel: SPC A g
|
||||
4. Now AI knows about the reference file!
|
||||
```
|
||||
|
||||
### 4. Quick Explanations
|
||||
```
|
||||
1. Hover over word or select code
|
||||
2. SPC a q
|
||||
2. SPC A q
|
||||
3. See explanation in popup!
|
||||
```
|
||||
|
||||
### 5. Code Completion
|
||||
```
|
||||
Start typing code...
|
||||
M-TAB → Shows AI completion as ghost text
|
||||
TAB → Accept completion
|
||||
M-TAB or SPC A C → Request AI completion (shows as ghost text)
|
||||
C-c C-a or SPC A a → Accept the completion
|
||||
```
|
||||
|
||||
---
|
||||
@@ -188,18 +191,18 @@ Want to run AI locally for privacy?
|
||||
|
||||
1. **Save conversations**: gptel uses org-mode by default, so just save the buffer!
|
||||
|
||||
2. **Switch models on-the-fly**: `C-u SPC a s` before sending
|
||||
2. **Switch models on-the-fly**: `C-u SPC A s` before sending
|
||||
|
||||
3. **Context management**:
|
||||
- Add files in Dired: Mark files → `SPC a c`
|
||||
- Remove context: `SPC a m` → Manage context
|
||||
- Add files in Dired: Mark files → `SPC A c`
|
||||
- Remove context: `SPC A m` → Manage context
|
||||
|
||||
4. **Org-mode features**:
|
||||
- Each heading can be a separate conversation branch
|
||||
- Set properties: `M-x gptel-org-set-properties`
|
||||
- Set topic: `M-x gptel-org-set-topic`
|
||||
|
||||
5. **Custom instructions**: Use `SPC a r` on selected code and give specific instructions
|
||||
5. **Custom instructions**: Use `SPC A r` on selected code and give specific instructions
|
||||
|
||||
6. **Programmatic use**: See helper functions at bottom of `ai.el` for examples
|
||||
|
||||
@@ -210,7 +213,7 @@ Want to run AI locally for privacy?
|
||||
1. **Secure your API key** (see section above)
|
||||
2. **Run:** `doom sync` to install packages
|
||||
3. **Restart Emacs**
|
||||
4. **Try:** `SPC a g` to start chatting!
|
||||
4. **Try:** `SPC A g` to start chatting!
|
||||
5. **Watch:** "Every LLM in Emacs, with gptel" video (17 min)
|
||||
|
||||
---
|
||||
@@ -235,10 +238,12 @@ Then: `M-x package-install RET transient RET`
|
||||
- Ensure proper encryption password
|
||||
- Test: `(auth-source-pick-first-password :host "openrouter.ai")`
|
||||
|
||||
### Autocomplete not showing?
|
||||
- Enable manually: `M-x gptel-autocomplete-mode`
|
||||
- Check if in prog-mode buffer
|
||||
- May need specific model configuration
|
||||
### Autocomplete not working?
|
||||
- Trigger manually: `M-x gptel-complete` or `M-TAB`
|
||||
- Accept completion: `M-x gptel-accept-completion` or `C-c C-a`
|
||||
- Note: There's no auto-mode - you trigger completions on-demand
|
||||
- Check gptel is configured and working first (`SPC A g`)
|
||||
- Adjust context size if needed (see `gptel-autocomplete-*-context-lines` variables)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user