You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you configure the $EDITOR environment variable to be vim in your .profile, .bashrc, .zshrc, or equivalent thing for your shell.
You can launch into your $EDITOR using leader, e (leader by default is ctrl+x. Then you can edit the message in vim or whatever editor you prefer. It's different from having vim mode in the default messaging, but it's nice as you also get your .vimrc customizations.
I didn't realize the editor was for the messaging when I first started using opencode 🤣, and you can pop into it in the middle of editing a message and it'll handle the contents into vim and out when you write and quit (it does not auto send when you exit the editor).
Reacted by Rauf, Marcus Yu, thuanpham582002, Peter Jun Koh, Fred Blaise, Tomáš Konrády, Daniel Bosk, Ajay Mamtora, SOFe (Jonathan Chan Kwan Yin) and mihem
thanks for your reply @scaryrawr but that's a little different. ctrl-x e opens the editor (e.g. vim) in a separate window. I meant supporting vim shortcuts inside the prompt input field. BTW, zed also has this feature for example (ofc that is built into the IDE).
Reacted by Fred Blaise, Rom888, Sepehr Soltanieh, Dan (Danilo) Rio (Ribeiro), Carlos E. Salazar and José María
there is a PR for this but not sure if we're going to add this feature at the moment - vim modes tend to be kind of shitty feeling because they end up as partial implementations
Reacted by Scott Giminiani, Sepehr Soltanieh, Hongyu Lin, Anatoli Tsinovoy, Rikato, Noah Kim, Andrey Stepanov, Liang-Shih Lin, oribi, Tim and 52 more
I'll just add my 2 cents, as someone who's looking for a vim implementation, that even basic vim modes are helpful / a good start. I'm pairing up opencode with the opencode.nvim plugin and having some sort of vim mode with being able to go into insert mode, out of insert mode, with some of the basic vim navigation keys would help in fitting this more into a vim code editor.
That said, it's just my 2 cents, not a dealbreaker by any means.
Reacted by Arun, Jensen, Tyler Barnes, Julian Marotta, Hongyu Lin, Julian Marotta, david ben-kalifa, DS, Jorgen Henriksen, Jeremy Morrison and 43 more
An ambitious thing would be adding a neovim client to opencode, something like what firenvim does. I imagine you could hijack shift+enter to save and quit the buffer to send the prompt. At least there would be no partial vim mode.
Reacted by Hernán Cervera, Noah Kim, Dan (Danilo) Rio (Ribeiro), Daniel for Prime Minister, Chris Lasher, Maor, Naser Owaimer, Walter and Orlando Vargas
I'd argue that this is more useful than using external full-fledged editors because some of the built-in autocomplete features such as referencing files by using @ doesn't work quite as well as in the OpenCode's prompt box when you use an external editor. Therefore, it'd be much better if the prompt box itself had a built-in Vim mode, just like Claude Code's TUI.
Reacted by Chris Lasher, Shivam Kumar, Udo, Radek Tomšej, Keqi Zeng, Samuel Masuy, evatt-harvey-salinger-ai, Hongyu Lin, Jeongseop Lim, Anatoli Tsinovoy and 5 more
Would really love this as without it - it makes using opencode quite awkward for me. I find that using an external editor means I loose context when writing prompts.
What would be great is that when we open the external editor, the context is opened (like when exporting the current session). It would required to strip out the context before submitting the prompt but would allow all the benefit of neovim (like yanking context content)
They're not re-using any library or so, they just implement the feature as they're known.
Of course this is a classic vibe code: I've no proper experience with TS, bun, anything used in opencode.
I'm not planning to make a PR, I don't think this is how collaborating here would work and likely no one would want to merge this. Anyone with more skills in these areas can probably make much better vibe coded results anyway.
TL;DR: "sort of" working was easy, the last 80% are likely the hardest ;) and I don't know what I should do with the generated code. I would wish it was possible to just implement it as a plugin/extension with minimal intrusion.
Reacted by Matthias Tafelmeier, caiguo, Dave Yarwood, John Haynes, Harshit Sharma, ccolorado, SidneySun and Seongho.Bak
ocv - opencode release with vim insert/normal mode that tracks upstream automatically.
Reacted by Markus Podar, Matthias Tafelmeier, Sander, Yusuke Minami, Normen Hansen, Walter, Gordon Child, Denis Ismail, Antoine Gaudreau Simard and Rom888
i recently tried cursor agent, it has couple of vim commands and option, it's very limited, but felt very referesing using vim edits the prompt input for the very first time, hope this get merged in opencode soon
Reacted by Scott Giminiani, Damian and Fernando Nunez
vim motions are the only prompt box editing motions you don't need to re-learn, i'd really love this feature too! (as shitty and incomplete they can feel at times, not having any shortcuts that are intuitive today inside the prompt box, feels worse)
Activity
scaryrawr commentedon Aug 10, 2025
Ah, if you're OK with editing messages in vim.
If you configure the
$EDITORenvironment variable to bevimin your.profile,.bashrc,.zshrc, or equivalent thing for your shell.You can launch into your
$EDITORusingleader, e(leader by default isctrl+x. Then you can edit the message in vim or whatever editor you prefer. It's different from having vim mode in the default messaging, but it's nice as you also get your.vimrccustomizations.I didn't realize the editor was for the messaging when I first started using opencode 🤣, and you can pop into it in the middle of editing a message and it'll handle the contents into vim and out when you write and quit (it does not auto send when you exit the editor).
dudeinthemirror commentedon Aug 12, 2025
thanks for your reply @scaryrawr but that's a little different.
ctrl-x eopens the editor (e.g. vim) in a separate window. I meant supporting vim shortcuts inside the prompt input field. BTW, zed also has this feature for example (ofc that is built into the IDE).thdxr commentedon Aug 12, 2025
there is a PR for this but not sure if we're going to add this feature at the moment - vim modes tend to be kind of shitty feeling because they end up as partial implementations
dudeinthemirror commentedon Aug 13, 2025
thanks Dax, that makes sense. Please close the issue, or let me know if you want me to do it.
Thank you.
AhmedNSidd commentedon Aug 13, 2025
I'll just add my 2 cents, as someone who's looking for a vim implementation, that even basic vim modes are helpful / a good start. I'm pairing up opencode with the opencode.nvim plugin and having some sort of vim mode with being able to go into insert mode, out of insert mode, with some of the basic vim navigation keys would help in fitting this more into a vim code editor.
That said, it's just my 2 cents, not a dealbreaker by any means.
zsmatrix62 commentedon Aug 15, 2025
+1
ferdinandyb commentedon Oct 11, 2025
An ambitious thing would be adding a neovim client to opencode, something like what firenvim does. I imagine you could hijack shift+enter to save and quit the buffer to send the prompt. At least there would be no partial vim mode.
[-]Feature request: edit mode vim[/-][+][FEATURE]: vim motions in input box[/+]sepsol commentedon Dec 31, 2025
I'd argue that this is more useful than using external full-fledged editors because some of the built-in autocomplete features such as referencing files by using @ doesn't work quite as well as in the OpenCode's prompt box when you use an external editor. Therefore, it'd be much better if the prompt box itself had a built-in Vim mode, just like Claude Code's TUI.
ryardley commentedon Jan 14, 2026
Would really love this as without it - it makes using opencode quite awkward for me. I find that using an external editor means I loose context when writing prompts.
MartinDelille commentedon Jan 14, 2026
What would be great is that when we open the external editor, the context is opened (like when exporting the current session). It would required to strip out the context before submitting the prompt but would allow all the benefit of neovim (like yanking context content)
13 remaining items
ferdinandyb commentedon Mar 6, 2026
Claude Code's UI is terrible in many ways so I would not drag that here
cherusk commentedon Mar 6, 2026
@ferdinandyb many on the thread have done so though.
mfn commentedon Mar 7, 2026
I let opencode go wild on opencode to make a PoC vim-mode:
Screen.Recording.2026-03-07.at.10.58.15.mov
It has only half the features one would need but has more bugs than a sieve has leaks: but it "sort of works".
What I find most interesting is that I pressed the agent hard to make the changes as unobstrusive as possible:
Only these changes in the actual code are necessary
Besides that, these are the only other files added:
They're not re-using any library or so, they just implement the feature as they're known.
Of course this is a classic vibe code: I've no proper experience with TS, bun, anything used in opencode.
I'm not planning to make a PR, I don't think this is how collaborating here would work and likely no one would want to merge this. Anyone with more skills in these areas can probably make much better vibe coded results anyway.
TL;DR: "sort of" working was easy, the last 80% are likely the hardest ;) and I don't know what I should do with the generated code. I would wish it was possible to just implement it as a plugin/extension with minimal intrusion.
cherusk commentedon Mar 7, 2026
@mfn that is the spirit!
leohenon commentedon Mar 8, 2026
ocv - opencode release with vim insert/normal mode that tracks upstream automatically.
cherusk commentedon Mar 9, 2026
@leohenon - supersweet - are you mainlining it? Or why not?
leohenon commentedon Mar 11, 2026
@cherusk Yes, #12679
gpu004 commentedon May 26, 2026
i recently tried cursor agent, it has couple of vim commands and option, it's very limited, but felt very referesing using vim edits the prompt input for the very first time, hope this get merged in opencode soon
epicwhale commentedon Jun 10, 2026
vim motions are the only prompt box editing motions you don't need to re-learn, i'd really love this feature too! (as shitty and incomplete they can feel at times, not having any shortcuts that are intuitive today inside the prompt box, feels worse)
claytonweaver commentedon Jul 4, 2026
can we merge this pretty please ?
AntoineGS commentedon Jul 15, 2026
Highly recommend anyone landing here to use this!
@leohenon I take it the changes are too big for this to be a plugin?
github-actions commentedon Sep 14, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.