philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
22.91k stars 2.46k forks source link

`unmapAll` as a Command / Binding #4121

Open innateessence opened 1 year ago

innateessence commented 1 year ago

Use-case:

It'd be nice to be able to map ZZ in insert mode to unmapAll for whenever I'm doing code challenges that have an online IDE.

Problem statement

I instinctively press "Esc" to exit insert mode in the editor, which puts vimium in normal mode but leaves the online IDE in insert mode and is a frustrating thing to experience.

I'm sure there are other use-cases for this as well, I may end up submitting a PR if people agree this is a good idea.

Work around

For now, I'll just set vimium to ignore the URL where those online IDEs are relevant, which is good enough, but not ideal imo.

Rationale

'ZZ' - essentially an alias to :q in vim. (seeing as how x is actually 'exit-tab', ZZ makes a lot of sense)

Considerations

If I make a PR, I might make it a default binding, or perhaps just a Command that a user can use as a custom binding. Might be a good idea to get some input

gdh1995 commented 1 year ago

You may try my customized version of Vimium, named Vimium C (https://github.com/gdh1995/vimium-c), and I've added a special option of "Compatibility of Escape", and it's a list of CSS selectors: