helix icon indicating copy to clipboard operation
helix copied to clipboard

Globally invert up and down (j and k)

Open jharrilim opened this issue 3 years ago • 3 comments

I personally like to use j as up and k as down. I can configure it for normal mode:

[keys.normal]
j = "move_line_up"
k = "move_line_down"

However, I cannot currently configure it for view mode or window mode. It would be a neat enhancement to be able to configure these, but potentially in a more global fashion. That way if any new features added movement capabilities, inversion would automatically be applied.

jharrilim avatar Sep 13 '22 17:09 jharrilim

I cannot currently configure it for view mode or window mode

This should be possible, for example

[keys.normal.z]
j = "scroll_up"
k = "scroll_down"

I think it's distasteful to add config options for things achievable through rebinding.

the-mikedavis avatar Sep 13 '22 18:09 the-mikedavis

That's fair! Didn't know I could do that. I misunderstood the section in this page where it says # At most one section each of 'keys.normal', 'keys.insert' and 'keys.select'. I can make a PR to add examples of minor mode rebindings to the docs if you'd like.

jharrilim avatar Sep 13 '22 21:09 jharrilim

Ah yeah, I think that's saying that you don't want to have duplicate [keys.normal] sections for example since the later one will override the former.

Showing an example of mapping sequences like z/Z/C-w would be great! I think that's a relatively common ask in the matrix

the-mikedavis avatar Sep 14 '22 09:09 the-mikedavis