[FEATURE]: vim motions in input box #1206

Open
opened 2026-02-16 17:30:00 -05:00 by yindo · 16 comments
Owner

Originally created by @dudeinthemirror on GitHub (Aug 9, 2025).

Originally assigned to: @thdxr on GitHub.

Please add the option of using vim keyboard shortcuts when writing the prompt (ClaudeCode has it, see attached)

Image Image
Originally created by @dudeinthemirror on GitHub (Aug 9, 2025). Originally assigned to: @thdxr on GitHub. Please add the option of using vim keyboard shortcuts when writing the prompt (ClaudeCode has it, see attached) <img width="369" height="96" alt="Image" src="https://github.com/user-attachments/assets/717db25e-9df6-4bd5-a6d2-91444f8be2fd" /> <img width="777" height="511" alt="Image" src="https://github.com/user-attachments/assets/1cddb038-dda9-4618-971c-c3db0ae21e34" />
yindo added the discussiontui labels 2026-02-16 17:30:00 -05:00
Author
Owner

@scaryrawr commented on GitHub (Aug 10, 2025):

Ah, if you're OK with editing messages in vim.

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).

@scaryrawr commented on GitHub (Aug 10, 2025): Ah, if you're OK with editing messages in vim. 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 :rofl:, 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).
Author
Owner

@dudeinthemirror commented on GitHub (Aug 11, 2025):

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).

@dudeinthemirror commented on GitHub (Aug 11, 2025): 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).
Author
Owner

@thdxr commented on GitHub (Aug 11, 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

@thdxr commented on GitHub (Aug 11, 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
Author
Owner

@dudeinthemirror commented on GitHub (Aug 12, 2025):

thanks Dax, that makes sense. Please close the issue, or let me know if you want me to do it.
Thank you.

@dudeinthemirror commented on GitHub (Aug 12, 2025): thanks Dax, that makes sense. Please close the issue, or let me know if you want me to do it. Thank you.
Author
Owner

@AhmedNSidd commented on GitHub (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.

@AhmedNSidd commented on GitHub (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](https://github.com/NickvanDyke/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.
Author
Owner

@zsmatrix62 commented on GitHub (Aug 15, 2025):

+1

@zsmatrix62 commented on GitHub (Aug 15, 2025): +1
Author
Owner

@ferdinandyb commented on GitHub (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.

@ferdinandyb commented on GitHub (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.
Author
Owner

@sepsol commented on GitHub (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.

@sepsol commented on GitHub (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.
Author
Owner

@ryardley commented on GitHub (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.

@ryardley commented on GitHub (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.
Author
Owner

@MartinDelille commented on GitHub (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)

@MartinDelille commented on GitHub (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)
Author
Owner

@ferdinandyb commented on GitHub (Jan 15, 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.

I had a suggestion to allow to preserve context in a way: https://github.com/anomalyco/opencode/issues/5016, but it's more for replying. Btw, it should be trivial to delete any quoted stuff in vim. If opencode could open editor in a way that vim knows, you could even configure stripping quotes and exit or something.

@ferdinandyb commented on GitHub (Jan 15, 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. I had a suggestion to allow to preserve context in a way: https://github.com/anomalyco/opencode/issues/5016, but it's more for replying. Btw, it should be trivial to delete any quoted stuff in `vim`. If opencode could open editor in a way that vim knows, you could even configure stripping quotes and exit or something.
Author
Owner

@kremovtort commented on GitHub (Jan 24, 2026):

There is solid neovim plugin that rebuilds opencode interface in neovim and gives native neovim experience: https://github.com/sudo-tee/opencode.nvim

@kremovtort commented on GitHub (Jan 24, 2026): There is solid neovim plugin that rebuilds opencode interface in neovim and gives native neovim experience: https://github.com/sudo-tee/opencode.nvim
Author
Owner

@cherusk commented on GitHub (Jan 29, 2026):

That sets claude-code really apart ... opencoude has to have it.

@cherusk commented on GitHub (Jan 29, 2026): That sets claude-code really apart ... opencoude has to have it.
Author
Owner

@charafmrah commented on GitHub (Jan 30, 2026):

This is one of my biggest pain points with using opencode. Not a dealbreaker on its own, but sorely missing.

@charafmrah commented on GitHub (Jan 30, 2026): This is one of my biggest pain points with using opencode. Not a dealbreaker on its own, but sorely missing.
Author
Owner

@kbenzie commented on GitHub (Jan 30, 2026):

Where having vim-mode would really shine for me is fixing small typos quickly and not loosing my train of thought fighting against muscle memory to navigate around with arrow keys or ctrl chords. The vi subset is sufficient for this purpose, as supplied by readline.

A partial implementation is not an issue in my eyes, none of the other agent tui's have a fully featured vim mode either.

@kbenzie commented on GitHub (Jan 30, 2026): Where having vim-mode would really shine for me is fixing small typos quickly and not loosing my train of thought fighting against muscle memory to navigate around with arrow keys or ctrl chords. The vi subset is sufficient for this purpose, as supplied by readline. A partial implementation is not an issue in my eyes, none of the other agent tui's have a fully featured vim mode either.
Author
Owner

@hackel commented on GitHub (Feb 10, 2026):

Coming from GitHub Copilot CLI (which is also lacking this basic feature), adding it to Open Code would really give it an edge. It's a shame more projects don't just use actual readline or a similar library that has this built-in so they all don't have to reinvent the wheel themselves.

Thanks for your effort @leohenon, it looks very promising!

@hackel commented on GitHub (Feb 10, 2026): Coming from GitHub Copilot CLI (which is also lacking this basic feature), adding it to Open Code would really give it an edge. It's a shame more projects don't just use actual readline or a similar library that has this built-in so they all don't have to reinvent the wheel themselves. Thanks for your effort @leohenon, it looks very promising!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1206