Skip to content

BrettKulp/opencode-vim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11,637 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode Vim

npm version CI Last commit Bun

opencode fork with vim mode. Syncs with upstream releases.

Install

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

Then run:

ocv

Update

npm i -g @leohenon/ocv@latest
# or
brew upgrade ocv
# or
ocv update

Features

Vim motions

Movement

h j k l w b e W B E 0 ^ _ $ gg G f F t T ; , Ctrl+e Ctrl+y Ctrl+d Ctrl+u Ctrl+f Ctrl+b

Editing

i I a A o O R x ~ dd dw cc cw S J

Yank / put / undo

yy yw p P u Ctrl+r

Visual

v V

Tip

Toggle via command palette (Ctrl+p -> Toggle vim mode).

Anthropic OAuth

Claude subscriptions built-in with /connect. No plugins or configuration needed.

Copy Mode

Text selection from the chat session view.

Works similarly to tmux copy mode within opencode tui.

  • Enter copy mode with <leader>v or Ctr + w + k to enter copy mode without scrolling the chat history to the bottom.
  • Navigate with h j k l or arrow keys (Left Down Up Right).
  • Press v / V to start character-wise or line-wise selection.
  • y yanks to the vim register.
  • Enter copies to the system clipboard.
  • Escape exits visual mode, q exits copy mode.
  • i exits copy mode without scrolling the chat history to the bottom and enters insert mode
  • Ctrl + w + j exits copy mode without scrolling the chat history to the bottom
  • 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 in your config if you want something other than <leader>v.

Note

Copy mode collapses code diffs into a single column for easy copying.

Prompt Input

Prompt input height is configurable with prompt_max_height in tui.json.

When the prompt grows past the visible area, a scrollbar appears automatically.

{
  "prompt_max_height": 35,
  "prompt_scrollbar": true
}

Note

When typing gg / G focus the prompt input.

Warning

Setting prompt_max_height above 40 is not recommended.

Minimal UI

Hides extra UI hints and tips.

Default Minimal

Tip

Toggle via command palette (Ctrl+p -> Toggle minimal ui).

Configuration

Submit behavior

By default, vim insert mode keeps Enter for newlines. If you want Enter to submit instead, add this to tui.json:

{
  "vim_enter_submit": true
}

Feedback

Have a suggestion? Open an issue.

About

The open source coding agent with vim mode.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 58.6%
  • MDX 37.6%
  • CSS 2.9%
  • Rust 0.5%
  • Astro 0.2%
  • Shell 0.1%
  • Other 0.1%