just install # install deps
just dev # launch OpenCode with the plugin loaded
just check # run lint + testsRunning opencode directly in this directory won't load the plugin. You need just dev, which sets OPENCODE_TUI_CONFIG=dev-tui.json.
- Add the key check in the right section of
src/vim.ts(handleNormalKey()for normal mode keys). - Return appropriate actions:
{ consume: true, actions: [{ type: "cmd", cmd: "input.some.command" }] } - Add a test in
test/vim.test.ts. - Run
just check, thenjust devto verify.
See AGENTS.md for operator+motion combos and other patterns.
All changes go through pull requests — direct pushes to main are blocked.
Use type/description with lowercase, hyphen-separated words:
feat/replace-charfix/escape-handlingchore/update-deps
Types match commit prefixes: feat, fix, refactor, chore, test, docs.
- Create a branch:
git checkout -b feat/your-feature - Make changes, run
just checklocally. It must pass with zero errors and zero warnings. - Push and open a PR against
main. - CI runs
just check. Warnings are treated as errors — the PR will be blocked until the check is fully clean. - PRs are squash-merged. The PR title becomes the commit message on
main.
Conventional-ish prefixes: feat:, fix:, refactor:, chore:, test:, docs:.
Follow Keep a Changelog. Add your change to [Unreleased] in CHANGELOG.md in the same PR. Past tense, reader's perspective, one bullet per change.
SemVer. 0.x.y until the plugin API stabilizes:
- PATCH: Bug fixes, docs
- MINOR: New keybindings, new features (backward compatible)
- MAJOR: Breaking changes, removed keybindings
Releases are manual.
- Check that
[Unreleased]in CHANGELOG.md is complete. - Decide the version bump (SemVer rules above).
- Move
[Unreleased]entries into a new## [X.Y.Z] — YYYY-MM-DDsection. - Update link references at the bottom of CHANGELOG.md.
- Bump version in
package.json(npm version X.Y.Z --no-git-tag-version). - Bump
VERSIONinsrc/version.tsto match. - Update all version tags in
README.md— the install snippet and the config example both reference a specific version. - Run
just check. - Open a PR with the release changes. Title:
Release vX.Y.Z: <one-line summary>. - After CI passes, squash-merge the PR.
- Tag and push:
git tag vX.Y.Z && git push origin vX.Y.Z - Create a GitHub release:
gh release create vX.Y.Z --title "vX.Y.Z" --latest --notes "<changelog section for this version>"
vimcode is installed via git URL in OpenCode's tui.json:
{ "plugin": ["vimcode@git+https://github.com/oribarilan/vimcode.git"] }Bare names (like "vimcode") trigger npm resolution, which won't work since the package isn't published. The @git+ prefix tells OpenCode to clone from GitHub.
src/vim.ts owns all key handling (pure functions). src/index.tsx owns all OpenCode API interaction. See AGENTS.md for the full architecture guide.