@kungfusaini/opencode-vim-mode
v0.1.3
Published
OpenCode TUI plugin that adds Vim-style modal editing, message selection, and prompt visual mode.
Maintainers
Readme
opencode-vim-mode
@kungfusaini/opencode-vim-mode is an OpenCode TUI plugin that adds a practical Vim-style modal layer to the prompt without patching OpenCode itself.
It is designed for people who want a more Vim-like OpenCode experience while still using the built-in TUI.
Features
Modal prompt editing
- insert and normal modes
- prompt mode badge in the footer
- startup defaults to insert mode
Normal-mode prompt motions and editing
h/lmove left and rightj/kare context-sensitive:- move inside multiline prompt input when possible
- otherwise scroll the pane
w/b,0/$a,A,Ix,dd,dw,db,Dcc,cw,cb,Cppaste from clipboard
Prompt visual mode
vcharacterwise visual mode in the input boxVlinewise visual mode in the input boxy,d,cfor selected prompt text
Message navigation and actions
J/Kselect next and previous visible messagesgg/Gjump to first and last message- selected message highlight
Enteropens message actions for an explicitly selected message- message actions currently include:
- Revert
- Copy
- Fork
Scrolling
ctrl+uhalf-page upctrl+dhalf-page down
Install
Use the normal OpenCode plugin installation path by adding the package to your tui.json plugin list:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": [
"@kungfusaini/opencode-vim-mode"
]
}Then restart OpenCode.
Notes
ctrl+din normal mode is repurposed for Vim-style half-page down while the prompt is focused, so usectrl+cor your other quit bindings to exit.- unhandled modified-key chords such as
ctrl+x, mare passed through in normal mode so OpenCode can complete them. Enterfor message actions only works when a message is actively selected withJ,K,gg, orG.- This plugin intentionally leans on current OpenCode/OpenTUI behavior and should be considered experimental.
Development
For local development, you can point OpenCode to your local build in tui.json:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": [
"file:///Users/sumeet/matrix/tools/opencode/opencode-vim-mode/src/index.js"
]
}Restart OpenCode after editing this config so it picks up file-based plugin changes.
Compatibility
- tested against OpenCode 1.15.x TUI behavior
License
MIT
