Toggle vim - Creates an Opencode command that toggles the VimMode off/on for this session.#29
Merged
Merged
Conversation
…hrough vim-motions - Implemented a toggle for VimMode using opencode commands.
Contributor
Author
|
Just want to confirm that at the moment, I have not tested this because the I have tried overwriting the |
Contributor
Author
|
It seems that there are issues when trying to replace the |
oribarilan
requested changes
Jun 9, 2026
oribarilan
left a comment
Owner
There was a problem hiding this comment.
thanks for this contribution! please see my comments
Contributor
Author
|
Tried to address all of the feedback! |
oribarilan
approved these changes
Jun 11, 2026
This was referenced Jun 11, 2026
oribarilan
pushed a commit
that referenced
this pull request
Jun 12, 2026
….keymap.registerLayer` (#34) Moves `:q`, `:quit`, and `:wq` to the `registerLayer` API, consolidating them with the existing `/vim` toggle command into a single `registerLayer` call. This was decoupled from #29 during review to keep that PR focused on the toggle feature. Changes: - Replaced `api.command?.register` with `api.keymap.registerLayer` for all three quit commands - Added `slashName` so they’re accessible as slash commands - Removed the now-unused `api.command?.register` call Closes #33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
/vimtoggle command Adds a runtime toggle to enable/disable vim mode without restarting OpenCode.
How it works?
Typing
/vimin the command palette flips state.disabled. When disabled, the key intercept returns early before any vim processing, so all keys pass through to OpenCode as if the plugin weren’t loaded. The state is persisted via api.kvso the preference survives restarts.Closes #4