[FEATURE]: vim motions in input box
Please add the option of using vim keyboard shortcuts when writing the prompt (ClaudeCode has it, see attached)
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).
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).
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
thanks Dax, that makes sense. Please close the issue, or let me know if you want me to do it. Thank you.
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.
+1
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.
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.
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)