Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable action in insert mode #4610

Open
MaiMarincic opened this issue Jan 17, 2025 · 2 comments
Open

Enable action in insert mode #4610

MaiMarincic opened this issue Jan 17, 2025 · 2 comments

Comments

@MaiMarincic
Copy link

MaiMarincic commented Jan 17, 2025

I am not sure if it's a bug however my Vomnibar.activateTabSelection is set to "c-space"
If I am writing text in whatever box the feature no longer works (In claude prompt box for example. Or youtube search bar). If I press the keybinding the default brave shortcut happens.
Now I assume vimium is just "deactivated/disabled" when in "insert mode" and only waits for escape. Can this be overwritten?

Basically what I want is to be able to use the TabSelection even when in insert mode. If anyone knows a way around this or can help me out greatly appreciated!
Using Chrome based browser (Brave)

@philg-dev
Copy link

philg-dev commented Jan 17, 2025

From how I understand it, "insert mode" in Vimium is meant to disable all Vimium keybindings except for escape, in order to send any key events directly to the underlying page instead of intercepting those events. This allows users to have their Vimium bindings active on sites and still have a way to access keybindings that are implemented by the website itself, e.g. YouTube, Google Docs and many more have a bunch of key bindings that would otherwise be "overridden" by Vimium's (default) keybindings.

From what I know, in Vimium it is currently not possible to define key bindings for "insert mode".

@UncleSnail
Copy link
Contributor

UncleSnail commented Jan 21, 2025

This is an interesting idea. If you have ctrl-based keybinds I could see wanting this. Vimium is loosely based on the Vim concepts, which is a "modal" editor, meaning it operates in modes, and in insert mode it is meant to pass all keys through, so you could think of is as being disabled. Modes don't only switch when in a text box, you can also push "i", for example, to enter insert mode and pass commands through.
Vim allows mapping shortcuts to different modes, and we could borrow something similar if we wanted to do this. The first thought would be:
map n zz resetZoom
for mapping zz in "normal" mode. But this would not do because it breaks all existing mappings, and most people will not want to put a mode. The most obvious existing solution would be to add an option to all commands for mode, similar to how count is used right now:
map zz resetZoom mode=i
This would allow shortcuts to be added in insert mode without breaking any existing mappings.
We could also do something like:
imap zz resetZoom or nmap zz resetZoom
but I prefer the mode=n option.

Although this is a very niche feature in the context of Vimium, I could see it being useful to have and I would try to implement it if we decide it is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants