gdh1995 / vimium-c

A keyboard shortcut browser extension for keyboard-based navigation and tab operations with an advanced omnibar
https://chrome.google.com/webstore/detail/vimium-c/hfjbmagddngcpeloejdejnfgbamkjaeg
Other
3.17k stars 253 forks source link

Mapping Navigation Keys to Default Keyboard Navigation Keys #1106

Open Bonapara opened 3 months ago

Bonapara commented 3 months ago

Desired behavior

My goal is to map Vimium C navigation keys to the default keyboard navigation keys.

For instance, I would love w to be mapped by ⌥→

It seems not to be supported, is there a workaround?

CleanShot 2024-03-07 at 12 44 18

Thanks!

gdh1995 commented 3 months ago

Sorry I can not get what do you want.

Could you explain the meanings of the two keys and what you wanted by the mapKey rule which was refused by Vimium C?

Bonapara commented 3 months ago

Hi @gdh1995, Thanks for your answer.

What I meant is that I want to use Mac shortcuts instead of Vim shortcuts in Visual/Edit mode.

Here are the shortcuts I'm talking about: Command–Left Arrow: Move the insertion point to the beginning of the current line. Command–Right Arrow: Move the insertion point to the end of the current line. Option–Left Arrow: Move the insertion point to the beginning of the previous word. Option–Right Arrow: Move the insertion point to the end of the next word. Shift–Up Arrow: Extend text selection to the nearest character at the same horizontal location on the line above. https://support.apple.com/en-us/HT201236#:~:text=Option%E2%80%93Left%20Arrow%3A%20Move%20the,the%20beginning%20of%20the%20document.

So I would love to map Vim shortcuts into these Mac Shortcuts in both Visual/Edit mode.

That's what I was trying to achieve with the custom key mapping, in the above example, mapping b in visual mode to ⌥→

(Now I realised I typed j instead of →)

And:

CleanShot 2024-03-07 at 18 57 53

Is not working :)

gdh1995 commented 3 months ago

No Vimium C can not change how your browser handles pressed keys.

VisualMode in Vimium C has its own shortcuts to move / extend cursors, which are basically borrowed from VIM - see https://github.com/philc/vimium/wiki/Visual-Mode