diff --git a/AGENTS.md b/AGENTS.md index 0b1998ec5012..5e17abf7ff32 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,4 +1,5 @@ - To regenerate the JavaScript SDK, run `./packages/sdk/js/script/build.ts`. +- To regenerate the GitHub Pages site from README.md, run `bun run build:site`. - ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE. - The default branch in this repo is `dev`. - Local `main` ref may not exist; use `dev` or `origin/dev` for diffs. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000000..b69a34a176fb --- /dev/null +++ b/docs/README.md @@ -0,0 +1,11 @@ +# Site + +GitHub Pages site for opencode-vim. + +To regenerate from README.md (run from repo root): + +``` +bun run build:site +``` + +This runs `site/build.ts` which converts `README.md` to `site/index.html` using `marked`. diff --git a/docs/build.ts b/docs/build.ts new file mode 100644 index 000000000000..933a2c30f339 --- /dev/null +++ b/docs/build.ts @@ -0,0 +1,109 @@ +#!/usr/bin/env bun +import { marked } from "marked" + +const RAW = "https://raw.githubusercontent.com/leohenon/opencode-vim/ocv" + +const head = ` + +
+ + +An OpenCode fork with a built-in vim mode. Syncs with upstream OpenCode releases.
+Adds a comprehensive + Vim mode, so you can navigate, edit text, and control your AI coding + assistant with the familiarity of Vim. If you have been missing Vim while using Opencode, this fixes that.
+
`
+
+const foot = `
+ An OpenCode fork with a built-in vim mode. Syncs with upstream OpenCode releases.
+Adds a comprehensive + Vim mode, so you can navigate, edit text, and control your AI coding + assistant with the familiarity of Vim. If you have been missing Vim while using Opencode, this fixes that.
+
+
+# npm
+npm i -g @leohenon/ocv
+
+# Homebrew
+brew install leohenon/tap/ocv
+
+# curl
+curl -fsSL https://raw.githubusercontent.com/leohenon/opencode-vim/ocv/install.sh | sudo sh
+
+ocv
+
+# npm
+npm i -g @leohenon/ocv@latest
+
+# Homebrew
+brew upgrade ocv
+
+# built-in updater
+ocv update
+
+Toggle via command palette (Ctrl+p -> Toggle vim mode).
++Unicode word boundaries are not supported.
+
| Category | +Keys | +
|---|---|
| Character / word | +h, j, k, l, w, b, e, W, B, E |
+
| Line / buffer | +0, ^, _, $, gg, G |
+
| Matching / paragraph | +%, {, } |
+
| Find / till | +f, F, t, T, ;, , |
+
| Scroll | +Ctrl+e, Ctrl+y, Ctrl+d, Ctrl+u, Ctrl+f, Ctrl+b |
+
| Insert / replace | +i, I, a, A, o, O, R |
+
| Character / line edit | +r, x, ~, s, S, J, C, dd, cc |
+
| Word changes | +cw, cb, ciw, caw, ciW, caW |
+
| Word deletes | +dw, db, diw, daw, diW, daW |
+
| Quote changes | +ci", ca", ci', ca', ci` , ca` |
+
| Quote deletes | +di", da", di', da', di` , da` |
+
| Bracket changes | +ci(, ca(, ci[, ca[, ci{, ca{, ci<, ca< |
+
| Bracket deletes | +di(, da(, di[, da[, di{, da{, di<, da< |
+
| Find / till operators | +cf, cF, ct, cT, df, dF, dt, dT |
+
| Matching / paragraph operators | +c%, d%, c}, c{, d}, d{ |
+
| Line / word yanks | +yy, yw, yiw, yaw, yiW, yaW |
+
| Quote yanks | +yi", ya", yi', ya', yi` , ya` |
+
| Bracket yanks | +yi(, ya(, yi[, ya[, yi{, ya{, yi<, ya< |
+
| Matching / paragraph yanks | +y%, y}, y{ |
+
| Put / undo / repeat | +p, P, u, Ctrl+r, . |
+
| Visual selection | +v, V |
+
++Note: +
+<leader>ycopies the prompt selection when present; configure it withkeybinds.prompt_copy_selection. +For clipboard sync, see System clipboard register.
Claude subscriptions built-in with /connect. No plugins or configuration needed.
Text selection from the chat session view.
+++Copy mode collapses code diffs into a single column for easy copying.
+

<leader>v or Ctrl+W k.h j k l or arrow keys (Left Down Up Right).v / V to start character-wise or line-wise selection.y/yy yanks to the vim register.Enter copies to the system clipboard.Y yanks to the vim register and scrolls to the bottom.Shift+Enter copies to the system clipboard and scrolls to the bottom.Escape exits visual mode, q exits copy mode and scrolls to the bottom.Ctrl+W j exits copy mode without scrolling; Ctrl+W w toggles copy mode.i focuses the prompt input in insert mode without scrolling.z zt zz zb adjust copy-mode scroll positioning.H / M / L jump to the top / middle / bottom of the viewport.++Tip: +Configure the entry key with
+keybinds.copy_mode.
Prompt input height is configurable with prompt_max_height in tui.json.
A scrollbar appears when the prompt exceeds the visible area. gg / G focus the prompt input when typing.
{
+ "prompt_max_height": 35,
+ "prompt_scrollbar": true
+}
+
+++Setting
+prompt_max_heightabove40is not recommended.

Hides extra UI hints and tips.
+| Default | +Minimal | +
|---|---|
![]() |
+![]() |
+
Toggle via command palette (Ctrl+p -> Toggle minimal ui).
By default, vim insert mode keeps Enter for newlines and normal mode uses Enter to submit. If you want Enter to submit from insert mode too, add this to tui.json:
{
+ "vim_enter_submit": true
+}
+
+When vim_enter_submit is enabled, line returns are still available through input_newline.
{
+ "keybinds": {
+ "input_newline": "alt+return"
+ }
+}
+
+If you keep vim_enter_submit disabled but want a separate submit key that works from insert mode, configure input_force_submit:
{
+ "keybinds": {
+ "input_force_submit": "alt+return"
+ }
+}
+
+By default, input_force_submit is unbound.
By default, vim mode uses an internal register for y and p. If you want yank and paste to use the system clipboard instead, add this to tui.json:
{
+ "vim_system_clipboard_register": true
+}
+
+With this enabled, yank operations sync to the system clipboard and p / P paste from it.
++Note: +Terminal/OS clipboard shortcuts don’t preserve Vim linewise register state. External clipboard text is pasted as characterwise text.
+
Compatible with opencode.nvim. Use the following server config:
local ocv_cmd = "bash -c 'exec -a opencode ocv --port'"
+
+vim.g.opencode_opts = {
+ server = {
+ start = function()
+ require("opencode.terminal").open(ocv_cmd)
+ end,
+ toggle = function()
+ require("opencode.terminal").toggle(ocv_cmd)
+ end,
+ },
+}
+
+Have a suggestion? Open an issue.
+Thanks to everyone who contributed.
+ + + + +