Skip to main content

Inline edit (Cmd+I)

⌘I / Ctrl+I edits this file in the editor, not a long agent turn in the sidebar. Type what you want in the Knox composer (the Send button reads Edit), and Knox streams a reviewable vertical diff. Accept or reject it. No fill-in-the-middle / ghost-text model is used.

Command palette: Knox: Generate Code. Keybinding title: Edit code with natural language.

This is the 2.2 in-editor assist path. Ghost-text inline completions stay off (knoxchat.enableInlineCompletions, default false). Copilot-style next-edit-while-you-type is not planned.

Keys​

ActionmacOSWindows / Linux
Edit selection (or stub/TODO under the cursor)⌘ICtrl+I
Enter edit mode without clearing the composer⌘⇧ICtrl+Shift+I
Exit edit modeEsc (editor focused)Esc
Accept the diff⌘⇧EnterCtrl+Shift+Enter
Reject the diff⌘⇧⌫ (or ⌘Z while the diff is visible)Ctrl+Shift+Backspace
Accept one vertical-diff block⌥⌘YAlt+Ctrl+Y
Reject one vertical-diff block⌥⌘NAlt+Ctrl+N
Apply a code block from the last chat reply⌥AAlt+A

⌘I starts a fresh edit session (the current chat is saved and cleared) and focuses the composer. With a selection, that range is the edit target. With no selection, Knox scopes to the stub, TODO/FIXME, or empty-file target under the cursor — the same ranges CodeLens uses.

⌘⇧I enters edit mode without clearing the composer. Composer focus waits about two seconds so you can finish what you were typing in the editor.

Knox: New Conversation while editing rejects the pending diff and leaves edit mode.

If knoxchat.showInlineTip is on (default), the editor can show a one-line tip for ⌘L / ⌘I.

CodeLens (same path as Cmd+I)​

With knoxchat.editAssist.codeLens (default on), Knox puts a CodeLens on:

LensWhen
Knox: Generate this fileThe file is empty
Knox: ImplementA stub function
Knox: Do this TODOTODO / FIXME comments (not already inside a stub)
Knox: Fix this errorError diagnostics (up to 5 per file)

Each lens runs the same reviewable edit as Cmd+I. No completion model. Files over ~400k characters skip CodeLens. Set knoxchat.editAssist.codeLens to false to hide the lenses.

Checkpoint inline-diff CodeLens (knox.checkpoints.inlineDiff.showCodeLens) is a different control — it labels checkpoint diffs, not assist.

After you Accept​

If knoxchat.editAssist.nextEdit is on (default), Knox may ask:

Knox: look for one related edit in this file?

Show one edit / No thanks. That follow-up runs once, as another reviewable diff, and never while you type.

Apply from chat and shadow preview​

Knox: Apply Code from Chat (⌥A / Alt+A) takes the next code block of the latest reply and applies it in the editor (vertical diff). That is not Cmd+I.

Shadow preview (knoxchat.enableShadowPreview, default off): before applying a chat edit to an existing non-empty file, Knox can open a side-by-side Original ↔ Proposed diff. Accept continues the normal vertical-diff apply; Reject discards. Files over 4000 lines skip shadow unless knoxchat.shadowPreviewLargeFiles is on.

Leave shadow off unless you want that extra prompt. Large C files stay on the vertical diff / apply_patch preview.

Review edits is different​

Review edits stages agent tool writes in memory. Cmd+I is you asking for a change in the current editor. You can use both in one session; they do not replace each other.

Sidebar chat with tools is still Chat UI + Ask / Edits / Auto.

Settings recap​

SettingDefaultEffect
knoxchat.editAssist.codeLensonCodeLens on empty files, stubs, TODOs, errors
knoxchat.editAssist.nextEditonOne related-edit offer after Accept
knoxchat.showInlineTiponShortcut tip in the editor
knoxchat.enableInlineCompletionsoffGhost-text; not a 2.2 product surface
knoxchat.enableShadowPreviewoffSide-by-side before apply to a non-empty file

Next​

Agent profiles · Review edits · First chat