4 ms·
This makes no sense. It is _meaning_ that bounds certain Vim commands to certain keys, not the position of the keys on your keyboard. Moving the keys around do
by johncoltrane 3y ago
This makes no sense.
It is _meaning_ that bounds certain Vim commands to certain keys, not the position of the keys on your keyboard. Moving the keys around doesn't change their meaning—"w" is still "w", for "word"—so making all those mappings is utterly pointless.
Unless one uses a layout different from that of their physical keyboard, in which case WTF?
- linsomniac 3y agoI believe the issue boils down to qwerty-hjkl become workman-yneo. hjkl don't have _meaning_, it's all about their specific location on the keyboard. So if yneo is now left/down/up/right, you now need to do something else for yank/next/end/open.
- johncoltrane 3y ago^H, ^J, ^K, and ^L _had_ meaning and that meaning is why hjkl do what they do. Their location on the homerow of a number of layouts is an accident. And they are not very useful in practice anyway. "Remapping" the whole keyboard around them is IMO a silly idea.
- linsomniac 3y agoHow do vertical tab and form feed relate to "up" and "right"?
- johncoltrane 3y agoYou would have to ask to the engineers at Lear Siegler who made that decision many decades ago. That choice and the subsequent decision to print the arrows on the corresponding keys of a single model of their product line are why we got hjkl for cursor movement in Vi first… and now seemingly everywhere.
- eimrine 3y agoI would like to suppose this is what Home and End does on any modern keyboard.
- lupire 3y agoNope. hjkl are arrow keys. https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys
- johncoltrane 3y ago"hjkl are arrow keys" because the arrows are printed on them and the arrows are printed on hjkl because pressing ^H, ^J, ^K, and ^L is what moved the cursor on the screen of the ADM-3A.
- lupire 3y agoYes, and H, ^J, ^K, and ^L is what moved the cursor on the screen of the ADM-3A because they are on the home row.
- eimrine 3y ago> ^H, ^J, ^K, and ^L _had_ meaning I can parse only High and Low which is what ^H and ^L do.
- johncoltrane 3y agoOn the ADM-3A, moving the cursor on the screen was done by pressing ^H, ^J, ^K, ^L. The convention had been established by no-one-knows-who at Lear Siegler even before that specific terminal model came out.
- 000ooo000 3y agoI'm not the author but have been on Workman and Vim for about 8 years. I don't think the meaning matters at all outside of the initial learning phase. Now it's all completely "muscle memory"; having to think "I want to move a word along, word starts with 'w' and 'w' is the key for moving a word along" would annihilate any efficiency modal editing gives. When I'm using Vim, it's just a matter of "I want the cursor there and I know this particular finger movement does that". I remapped probably Vim 10-15 keys 8 years ago, no issues so far.
- 000ooo000 3y agoIf anyone is interested on what I remapped, I deviated from HJKL for motion to JKLI (NEOI on Workman). I use space/shift+space for insert entry/exit, so losing I to a motion command was a nonissue. I then just mapped what NEO was to JKL. Wasn't a big deal surprisingly.
- teo_zero 3y agoIt's not all black or white. While most mappings are dictated by meaning, some are instead were chosen for their position, eg. hjkl, or relative position, eg. ? is the reverse of / just because in the US layout they are on the same key.
- eviks 3y agoIn reality there is very little meaning, there is just this false sense there is that keep all these bad defaults in place. Like, is it word forward or word backwards? W doesn't tell you. So if you're used to qwerty W it makes perfect sense to keep the much stronger muscle memory intact when switching layouts and use non-W in the same spot
- lawn 3y agoIt does make sense because Vim by default is forward looking, so `w` moves forward a word and the secondary effect is to move backward with `W`. As another example `diw` reads "Delete Inner Word", or `dap` reads "Delete Around Paragraph". It's way easier to just learn the new new keys and rely on the mnemonics IMO.
- eviks 3y agoStill doesn't, the forward looking part is misapplied for movements where you have both directions in separate keys (this principle could work for ops similar to tT (forward by default, backward shifted)), just like you can't explain why B is moving backwards by Words, not characters or something else (is there another important context you need to know that "vim is word looking by default"?). Or why it's not Below to move down And in your D example your skipped the first part - why is it not delete forward/backward by character/word? Why is it not Dump for paste just like there is this weird Yank for copy? Why not Do to execute some command? Or maybe D should do something tied to its looks. After all X is delete based on visual mnemonic of crossing something out It's even easier to learn relying on physical position mnemonics (like of your index J is go down by line, then go down by page is also index, but lower, so M). Or have adjacent fingers move left/right just like they move in cursors (Btw, letter based mnemonics are also not useful for most of the world since they're tied to English)
- lawn 3y agoJust because you could apply a different meaning to a character doesn't change the fact that some meaning, once learned, is more helpful than only relying on physical positions. Combining meaning with a physical position is even more superior than purely relying on one approach. And to me, it was far easier to switch layout while relying on mnemonics than on key position, and this continues to be true even when I add new keybindings now when I switch between multiple layouts. Maybe other brains works differently though.