Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Version

## [Unreleased]

### Added

- `:w` and `:write` now send the prompt instead of autocompleting to `:wq` and quitting OpenCode. Sessions auto-persist, so the natural mapping for vim users' reflexive "save" is to submit the current prompt. `:wq` still quits.

## [0.15.3] — 2026-07-01

### Fixed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ All normal-mode motions work for extending the selection: `h` `j` `k` `l` `w` `b
| `Ctrl+r` | Redo |
| `p` | Paste from yank register |
| `:` | Command palette |
| `:w` `:write` | Send prompt (via command palette) |
| `:q` `:quit` `:wq` | Quit OpenCode (via command palette) |
| `:vim` | Toggle vim mode on/off (persisted across restarts) |
| `/` | Jump to message (session timeline) |
Expand Down
13 changes: 13 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,22 @@ const plugin: TuiPluginModule = {
slashName: cmd,
run: exitRun,
}));
const submitRun = async () => {
setTimeout(() => api.keymap.dispatchCommand("input.submit"), 0);
};
const submitCommands = ["w", "write"].map((cmd) => ({
name: `vimcode.${cmd}`,
title: `:${cmd}`,
category: "Vim",
namespace: "palette",
desc: "Send prompt",
slashName: cmd,
run: submitRun,
}));
api.keymap.registerLayer?.({
commands: [
...exitCommands,
...submitCommands,
{
name: "vimcode.vim",
title: ":vim",
Expand Down