vimium icon indicating copy to clipboard operation
vimium copied to clipboard

How to change key mappings for caret moving?

Open wis opened this issue 7 years ago • 11 comments

can I change the HJKL to NEIO in Vimium? because I use the Colemak keyboard layout. couldn't find anything in the docs.

wis avatar Jun 25 '18 16:06 wis

@wis I haven't used Colemak, but I believe that simple key remapping should work for you. Take a look at Custom Key Mappings in REAME.

ris58h avatar Jul 02 '18 20:07 ris58h

thanks for trying to help @ris58h I should have mentioned Visual mode, I don't think it's an implemented feature to remap hjkl or any keys in different modes. I think they should be automatically remapped in all layers.

wis avatar Jul 02 '18 20:07 wis

They seem to be hardcoded. Please add commands for them they can be remapped.

fugounashi avatar Jul 18 '18 03:07 fugounashi

The keys for visual mode and caret mode are indeed currently hard coded.

smblott-github avatar Aug 10 '18 12:08 smblott-github

Would be nice to go into Caret mode with a single key press. I think one would like to start with Caret mode instead of Visual mode. Also uncertainty whether it will start in Visual or Caret mode with v does not help.

xged avatar Feb 10 '19 13:02 xged

If there is an existing selection (even a zero-length selection), then you get visual mode, otherwise caret mode.

smblott-github avatar Feb 10 '19 13:02 smblott-github

@smblott-github Oh, I see how it works now. That all makes sense. Maybe expand what "selection" means (mouse click) in https://github.com/philc/vimium/wiki/Visual-Mode.

xged avatar Feb 10 '19 13:02 xged

@smblott-github Just wanted to bump this issue. I successfully remapped the scrolling keys from hjkl to jklö (german keyboard) but the mapping doesn't work for moving the caret in visual / caret mode. This is really unfortunate since constantly switching between the two mappings is rather confusing.

Anudin avatar Apr 19 '19 12:04 Anudin

+1

teutat3s avatar Apr 29 '20 22:04 teutat3s

Here's an AD about my customized Vimium - gdh1995/vimium-c - it has both global remapping and pre-mode remapping.

By default, a mapkey rule takes effects in all modes (even FindMode and Vomnibar); and you can also map a same key to different keys in different modes, by adding a mode-id suffix. For example, mapkey <f:o> <f2> will only make Vomnibar treat f as <f2>.

Here're some available mode IDs: Insert = "i", Link = "l", Omni = "o", Find = "f", Visual = "v" and Marks = "m". For NormalMode, there's no ID character.

Its wiki about all mapkey usages is https://github.com/gdh1995/vimium-c/wiki/Use-in-another-keyboard-layout#mapkey-directive

gdh1995 avatar Apr 30 '20 01:04 gdh1995

FYI this issue appears to be resolved as it relates to Caret moving; however #4702 shows not working in Omnibar (ie. <C-j> & <C-k)

MapKey is actually implemented in philc's vimium; however it doesn't take multi-key bindings, or have modal support.

Thanks @gdh1995 for your reply; this is brilliant.

xtbqimuxmvtx avatar Jul 25 '25 03:07 xtbqimuxmvtx