Add an extra minor mode for cursor movements with position-based key mapping, liberating h-j-k-l for other commands #9896
Replies: 3 comments 1 reply
-
Not sure if it's possible. Just imagine: you have position-based hjkl mappings, while different layout and your a is on the place where others usually have h. What function should be on your a key? Positional-based? Or character based? |
Beta Was this translation helpful? Give feedback.
-
Colemak layout user here. I think the answer here is to have the editor provide named commands (e.g. move-to-next-word) as well as a default mapping file (e.g. w -> move-to-next-word) and let everyone define their own mapping in a way that does not break any key-cords. In vim, langmap was initially designed to support different keyboard layout but it failed because it's not well implemented and it breaks some plugins/key combination. The main problem I see with it is that actions (move-to-next-word) are confused with keys (w) which makes it impossible to use one without the other. For instance, some plugins will automaticaly assume that 'w' means 'move-to-next-word'. We need a better langmap support to swap keys that does not break anything. Then you will be free to place a named action on a positional key (say index finger, home row) or a mnemonic (say w on your layout) |
Beta Was this translation helpful? Give feedback.
-
One big trouble with modal editors I still have is the inadequate support for multiple keyboard layouts in the Normal mode (please correct me if there is an adequate support somewhere). When trying to find a solution, the following question arises:
Neither mnemonic, nor positional layout remapping is good for a Vim-like standard mapping because most keys are mapped based on their characters, but hjkl are mapped based on their position. (By the way, I am using asdf instead, or else I would use jkl;).
And then I just had this idea: why not have two Normal modes (major and minor?), where one uses a mnemonic key mapping and the other uses a positional key mapping?
Advantages:
The primary Normal mode would use mnemonic key mappings for operations on syntactic objects and for more advanced tasks, while the secondary Normal mode (Motion mode?) would use positional key mappings for single-key access to basic cursor motions and scrolling: left, right, up, down, page up, page down, half page up, half page down, go to the start of the line, go to the end of the line, go to column number, go to the first line, go to the last line, go to line number, scroll up, scroll down, scroll the current line to the top, scroll the current line to the bottom, scroll the current line to the middle, jump to the previous cursor position, jump to the next cursor position, etc.
Related issues and discussions:
Disclaimer: I have not really used Helix yet, I've only installed it and tried out. I am still using Vim with my key remapping plugin.
Beta Was this translation helpful? Give feedback.
All reactions