Uh oh!
There was an error while loading. Please reload this page.
feat(tui): add vi basic mode extension for prompt and editor - #7016
feat(tui): add vi basic mode extension for prompt and editor#7016ryangamerdev wants to merge 2 commits into
Conversation
The following comment was made by an LLM, it may be inaccurate: Duplicate PR Check Results for PR #7016 ✅ No duplicate PRs found. While the search found several related PRs focused on TUI keybindings and navigation, none are duplicates of PR #7016: Related (but distinct) PRs:
PR #7016 is unique as it implements a modular vi basic mode extension with specific vi keybindings (h/j/k/l, yank, delete, change, search operators, etc.) for the prompt component. This hasn't been addressed in any other open PR. |
ryangamerdev
commented
Jan 6, 2026
A modular vi mode implementation for the OpenCode TUI prompt with support
for use in standalone editors (like the project files viewer/editor).
Core Features:
- Normal and insert modes with standard vi keybindings
- Movement: h/j/k/l, w/b/e, 0/$, G, {/}, %, g{n}g, ctrl+f/b, arrows
- Delete: x, {n}x, dd, d{n}d, dw, d{n}w, D, d$, dG, d{n}G
- Change: cc, c{n}c, cw, c{n}w, C, s (insert space if landing on non-whitespace)
- Yank: yy, y{n}y, y$, yG, y%, y{, y}
- Paste: p/P (line-wise or character-wise based on yank content)
- Multiline: o (open below), O (open above), J (join lines)
- Other: r (replace char), ~ (toggle case), . (repeat), u (undo), ctrl+r (redo)
- Search: / (forward), ? (backward), n (next), N (previous) with regex support
- Search operators: d/, d?, c/, c?, y/, y? (delete/change/yank to search match)
Extension Architecture:
- PromptExtension interface for modular prompt extensions
- ViBasicOptions with textarea getter, onContentChange callback, mode config
- ViBasicResult exposes state, command buffer, yank register, search state
- lineNumbers option for gutter redraw workaround (opentui bug)
Configuration:
- prompt_vi_basic KV setting to enable/disable
- vi_basic_clip_x KV setting to control clipboard for single x deletes
- clipX option (default: false) - single x skips clipboard for key repeat
- {n}x always copies to clipboard (explicit action)
Prompt Integration:
- Status indicator shows mode (INSERT/vi basic/command buffer/search)
- ctrl+/ toggles vi mode on/off
- @ and / at position 0 pass through to autocomplete
- Arrow keys and j/k respect history navigation at document boundaries
- Escape handling respects vi mode state
Mode Configuration:
- full: For standalone editors, starts in normal mode
- prompt: For prompt input, starts in insert mode, / passes to menuThanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
ryangamerdev
commented
Jan 15, 2026
Closing PR, will use for personal use. Branch available on my fork if you want it. |



Summary
A modular vi mode implementation for the OpenCode TUI prompt with support for standalone editors.
Provides the vi extension for prompt but also for the Project Files Viewer and Editor
#7017
Core Features
h/j/k/l,w/b/e,0/$,G,{/},%,g{n}g,ctrl+f/bx,{n}x,dd,d{n}d,dw,d{n}w,D,d$,dG,d{n}Gcc,c{n}c,cw,c{n}w,C,syy,y{n}y,y$,yG,y%,y{,y}p/P(line-wise or character-wise)o,O,Jr,~,.,u,ctrl+r/,?,n,N(with regex support)d/,d?,c/,c?,y/,y?Configuration
prompt_vi_basicKV setting to enable/disablevi_basic_clip_xKV setting for clipboard behaviorArchitecture
PromptExtensioninterface for modular prompt extensionslineNumbersoption for gutter redraw (opentui workaround)full(for standalone editors) andprompt(for prompt input)Files Changed
lib/vi-basic-core.tslib/vi-basic-extension.tsxlib/prompt-extension.tscomponent/prompt/index.tsx