跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    kungfusaini

    Vim Mode

    v0.1.3界面与主题
    @kungfusaini/opencode-vim-mode

    OpenCode TUI plugin that adds Vim-style modal editing, message selection, and prompt visual mode.

    GitHub 星标

    0

    月装机量

    40

    近 7 天 9

    综合评分SCORE

    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"]
    }

    opencode 启动时会通过内嵌运行时自动加载 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 / l move left and right
    • j / k are context-sensitive:
      • move inside multiline prompt input when possible
      • otherwise scroll the pane
    • w / b, 0 / $
    • a, A, I
    • x, dd, dw, db, D
    • cc, cw, cb, C
    • p paste from clipboard

    Prompt visual mode

    • v characterwise visual mode in the input box
    • V linewise visual mode in the input box
    • y, d, c for selected prompt text

    Message navigation and actions

    • J / K select next and previous visible messages
    • gg / G jump to first and last message
    • selected message highlight
    • Enter opens message actions for an explicitly selected message
    • message actions currently include:
      • Revert
      • Copy
      • Fork

    Scrolling

    • ctrl+u half-page up
    • ctrl+d half-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+d in normal mode is repurposed for Vim-style half-page down while the prompt is focused, so use ctrl+c or your other quit bindings to exit.
    • Enter for message actions only works when a message is actively selected with J, K, gg, or G.
    • 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