diff --git a/README.md b/README.md index 693af7b..b21ea06 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,42 @@ The input window accepts multi-line prompts. Queued prompts are held until the c The mode line shows the active session ID and current state (`idle` or the running state name). +## Code Completion + +`ellie-complete` provides ghost-text code completion via a copilot session on ollie-9p. Press `M-/` to request a completion at point; the result appears as gray italic ghost text. + +| Key | Action | +|-----|--------| +| `M-/` | Request completion at point (or for selected region) | +| `TAB` / `RET` | Accept the suggestion | +| Any other key | Dismiss | +| `M-/` (while ghost visible) | Request a new completion (retries preserve region) | + +With an active region, the completion replaces the selected text. Without a region, it inserts after the current line. + +### Configuration + +| Variable | Env var | Description | +|----------|---------|-------------| +| `ellie-complete-backend` | `OLLIE_COMPLETE_BACKEND` | Backend for completion (required) | +| `ellie-complete-model` | `OLLIE_COMPLETE_MODEL` | Model for completion (required) | +| `ellie-complete-prefix-max` | — | Max chars of context before point (default: 4000) | +| `ellie-complete-suffix-max` | — | Max chars of context after point (default: 1000) | + +Example: + +```elisp +(setq ellie-complete-backend "ollama") +(setq ellie-complete-model "qwen3:4b") +``` + +Or via environment / `~/.config/ollie/env`: + +``` +OLLIE_COMPLETE_BACKEND=ollama +OLLIE_COMPLETE_MODEL=qwen3:4b +``` + ## License GPLv3 \ No newline at end of file