Skip to content

AI Overlay

jvim’s AI features are optional. After you configure a provider, the AI overlay (F6) offers Ask, Insert, and Rewrite modes. Inline ghost-text autocomplete and the AI context menu can also be enabled when you want model assistance. No network traffic is sent unless you explicitly invoke an AI feature.

▶ AI overlay: Ask, Insert, Rewrite, inline autocomplete
cast

Demo recording in progress — coming in the next release.

slug: ai-overlay

Press F6 to open the AI prompt overlay and choose a mode:

AI overlay mode picker

KeysActionNotes
F6Open AI overlayShows the mode picker: Ask / Insert / Rewrite
EscClose overlayDismiss without sending a prompt
Ctrl+ZUndo AI resultRevert an Insert or Rewrite after accepting

Ask is a Q&A interface that can use vault context. If the semantic index is available, the first response retrieves relevant chunks from your vault before generating an answer.

After the response, a Sources section lists the vault notes that contributed, with snippet previews. Use arrow keys to navigate sources and press O to open a source note directly.

Ask mode with RAG sources listed

KeysActionNotes
F6 → AskOpen Ask modeVault-aware Q&A; uses semantic index when available
EnterSubmit question / follow-upSend the prompt; subsequent Enter sends a follow-up
OOpen source noteOpens the highlighted RAG source in the editor

Insert generates new content at the cursor position. If you have text selected, that selection is passed to the model as context. If there is no selection, jvim uses the surrounding section as context automatically.

The generated text streams into the buffer in real time. Undo (Ctrl+Z) removes the entire insertion as one step.

Rewrite replaces a selection with AI-revised content. Select the text you want to improve, open the overlay with F6, choose Rewrite, and describe what you want changed. The model replaces the selection in-place.

If the result is not what you wanted, Ctrl+Z restores the original selection in a single undo step.

The context menu (Alt+/) opens an inline action picker next to the cursor — no full overlay needed. It lists common rewrite and insert actions: continue writing, complete paragraph, proofread, summarize, translate, change tone.

KeysActionNotes
Alt+/ or Ctrl+/Open AI context menuInline action picker at cursor position
↑ / ↓Select actionNavigate the action list
EnterRun actionApplies the selected action to the selection or context
EscCloseDismiss without running any action

When text is selected, rewrite-type actions (proofread, summarize, translate) use the selection as their target. Without a selection, insert-type actions (continue writing, complete paragraph) use surrounding context.

Inline autocomplete shows Copilot-style ghost text as you type. It is off by default — toggle it on with Alt+I or F9.

Once active, jvim requests a completion a moment after you stop typing. The suggestion appears as faint ghost text extending from your cursor. You can accept all of it, accept one word at a time, or simply continue typing to discard it.

KeysActionNotes
Alt+I / F9Toggle inline autocompleteEnable or disable ghost-text suggestions
TabAccept full suggestionInsert the entire ghost-text completion
→ / Ctrl+→Accept one wordInsert just the next word of the suggestion
Any other keyDiscard suggestionThe ghost text disappears; normal typing continues

The status bar shows an AI badge indicating whether inline autocomplete is active and surfacing any connection errors (missing API key, unreachable endpoint).

To use a faster, cheaper model for inline completions than for Ask/Rewrite, set inline_model separately in providers.toml.

jvim currently connects to OpenAI-compatible chat APIs. That includes OpenAI, Groq, local Ollama or llama.cpp servers that expose a /v1 API, and Anthropic only when routed through an OpenAI-compatible gateway.

Configure providers in ~/.config/jvim/providers.toml:

schema_version = 1
default_provider = "openai-cloud"
[[providers]]
id = "openai-cloud"
kind = "openai-compat"
base_url = "https://api.openai.com/v1"
api_key_env = "OPENAI_API_KEY"
default_model = "gpt-4o"
inline_model = "gpt-4o-mini" # optional: lighter model for ghost text
embedding_model = "text-embedding-3-small"

For local LLMs, point a provider at the server’s OpenAI-compatible endpoint:

schema_version = 1
default_provider = "ollama-local"
[[providers]]
id = "ollama-local"
kind = "openai-compat"
base_url = "http://localhost:11434/v1"
api_key_env = "OLLAMA_API_KEY" # any value if your server ignores auth
default_model = "llama3.2"
inline_model = "qwen2.5-coder:3b"
embedding_model = "nomic-embed-text"

No traffic is sent to any provider until you explicitly invoke an AI action. The inline autocomplete toggle is off by default.