Alternative "zxcv" keymap #1446
Replies: 4 comments 7 replies
-
Fantastic work! I'm so glad that there is someone out there that interesting in key binding and also have many similar thought with me. You should definitely check out XahLee blog about keybinding design:
XahLee blog is a great resource. It's the one that inspire me to create Bmap and it might help you learn a lot about keyboard ergonomic too! |
Beta Was this translation helpful? Give feedback.
-
I use dvorak and I think it's good that hjkl is not on the home row dvorak so I had to unlearn pressing hjkl and use more efficient keys like wbe instead. |
Beta Was this translation helpful? Give feedback.
-
I would add to the thought process the following: Instead of aliasing finger positions by their key cap values on any particular reified physical layout, one could natively locate the five fingers of each hand by their ordinal positions on the x-axes of a standard coordinate system: Then, place your fingers on a rounded surface (e.g. a basketball) in the most natural arm position and fingers in (most natural) "home row" position - they probably won't land in a row, though. That position is our base line: Then make abductor&flexor movements with each finger that roughly step with the size of an idealized keycap. You might find out, like I did, that depending on the finger, you only got +-1 abductor/reflexor steps up and down, while the thumb has more like +-3, and since our thumbs are opposed, that would translate in horizontal movement, not vertical. Nevertheless, we stick with e.g R11 & R1-2 for the thumb, alongsode the other fingers eg. R31 or R2-1 , etc. If you had bathed your fingers in color, you'd now have your ideal health-preserving, ergonomic keyboard painted on that basketball. For my hand, that renders a total of no more than 34 keys, and that includes stretching my pinky at times and diagonal-strech my pointer, while stripping one position from my thumb. But it's enough to cover the entire latin alphabet + commodities (space, esc, etc.). Now, from there, without the mental bias of any mnemonics, it is clear that everything that is concerned with movement must lay on the home row:
Fortunately, positions RL21 RL31 RL41 are almost as comfortable as the home row with only a very slight ergonomic penalty. But how many Mod keys do we usually have? 3, exactly! So we can symmetrically organize these mod-keys on these positions for R&L in such a way that each home row hand's direction key has a superposition of 3!+2 combination. Important detail: as trigger keys that only fire special meaning after XYZ ms, I think it's ~200ms on my keyboard (?). That, however, is largely enough to cover all the direction derivatives there are, including (most) selections. The trick is to use CSIu encoding to expand on the constraints of legacy to really get the full 3!+2 (=8) instead of only roughly 4 total combinations. (cTRL+O & related problems) Now we have 34-10 keys left to encode all the other commands with a power of 3!+2 on each key. Let's say we take out 2 less ergonomic positions (streched pinky & diagonal digit in my case), and we reserve the thumb positions for shifting keyboard layouts (e.g. numbers & punctuation layouts) we still get 3!+2x19 = 152 positions of highly ergonomic estate for all the other commands. In my opinion, this method, completely unbias by mnemonic legacy, is the best, most ergonomic, and hence most health-preserving method of thinking about keyboard layouts. If the luxury of a basketballshaped keyboard, ideally sliced at the symmetry point to be mounted on your chair's armrests, is not upon you, the next best thing really is to try to fit your body's ergonomics somewhat similar onto a regular keyboard. No mnemonics incolved. |
Beta Was this translation helpful? Give feedback.
-
FYI posted the better frequency-based layout here #6665 |
Beta Was this translation helpful? Give feedback.
-
I'd like to share a draft of a Helix keymap ZXCV (for lack of a better name) in an attempt to fix some of the vim design issues I didn't like and also match some of the common operations of the zxcv keys that I'm used to in other apps, or more specifically:
hjkl → jkl;
move_prev_word_start
/move_next_word_end
instead of b/eundo
/redo
instead of u/Shiftuearlier
/later
instead of Alt+u/Shiftuincrement
/decrement
instead of Ctrl+a/xgoto_previous_buffer
/goto_next_buffer
)(using this method to navigate tabs in all other apps, and Alt is a more convenient thumb-vs-palm/pinky modifier vs. Ctrl)
jump_backward
/jump_forward
)(or swap this with the above, 1/2 might be more convenient, but it breaks with the convention in other apps for me)
open_below
/open_above
as you only press it once)Undo
/Cut
/Copy
/Paste
to the more usual (to some) zxcv andredo
to the somewhat paired b2Extend/Select
mode), so the multi-cursor mode uses Alt+cursor:copy_selection_on_next_line
/copy_selection_on_prev_line
)rotate_selections_backward
/rotate_selections_forward
)remove_primary_selection
)keep_primary_selection
)Extend/Select
mode with Alt+q/w/e (extend_prev_word_start
,extend_next_word_end
,extend_next_word_start
)insert_mode
/prepend_to_line
to i,append_mode
/append_to_line
to o,open_below
/open_above
to u /+Shift)half_page_up
/half_page_down
to h/ngoto_line_start
/goto_line_end
to Shift+h/nopen_below
/open_above
)select_all
):write
)undo
)redo
)file_picker
)yank_main_selection_to_clipboard
,delete_selection
)yank_main_selection_to_clipboard
)paste_clipboard_after
)move_next_word_end
,delete_selection
)goto_previous_buffer
/goto_next_buffer
)Below are the 3 layouts — the new ZXCV along with the current default and the proposed default refactoring ( from this comment) — pasted as images, though it might be more convenient to view them in an html format in a dedicated repo page:
@KeyboardLayoutEditor, image, config
@KeyboardLayoutEditor, image; original without icons: @KeyboardLayoutEditor, image, source
@KeyboardLayoutEditor, image; original without icons: @KeyboardLayoutEditor, image, source
Footnotes
re. mnemonics: in such a complex keybind system such as Helix's I don't find them all that useful as they don't offer intuitive predictability due to said complexity since there are several alternatives to most of the keys, e.g., should c stand for Cut/Copy/Change/Collapse/Comment/Char/Command/Case/...? ↩
this breaks the 'sticky'
select_mode
as I don't know how to pass the 'sticky' option it via config, seems to be hardcoded inkeymap.rs
↩Beta Was this translation helpful? Give feedback.
All reactions