@kungfusaini/opencode-vim-modeOpenCode TUI plugin that adds Vim-style modal editing, message selection, and prompt visual mode.
0
40
近 7 天 9
26.2
生态多维模型
2 个月前
2026-06-08
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@kungfusaini/opencode-vim-mode@0.1.3"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@kungfusaini/opencode-vim-mode@0.1.3"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @kungfusaini/opencode-vim-modeopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
@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.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.
Compatibility
- tested against OpenCode 1.15.x TUI behavior
License
MIT