Remix.run Logo
▲ flaunf221 2 hours ago

Keyboard control schemes annoy me a lot, because most of them can be described as "draft of a potentially good idea that became holy book and engineering was forgotten".

For example - let's put "go all the way to the right" on the left button. And "go all the way to the left on the combo of modifier with right button". I'm talking about 0 and $ (Shift+4) for vi. It's not consistent, it's not ergonomic or easy to input when properly touch typing. It's almost an accidental control scheme because it was based on no longer existing keyboard keycap labels. And in this case where you can't even exit vi without first reading a manual, half an hour reduction in learning time that you get from remembering that `i` is Insert will not compensate for hundreds or thousands hours using later when you will be pressing button not by looking at keyboard but by muscle memory.

▲rmunn an hour ago | parent | next [-]

Huh, I never noticed that 0 is on the right side of the keyboard, even though obviously I type it every day so I knew that at some level. Because I think of the vi keybindings by their meaning, not their location. `y` is yank, `d` is delete (and copy to the clipboard, so basically cut, but the mnemonic is delete), and `0` is go to column 0. And `$` means end of string in regex, so that's what it means in vi. (And `^` is the vi shortcut for "go to first non-whitespace column", which is close enough to the regex meaning that I find it easy to remember as well).

Yeah, if keyboard positioning matters to your brain then you're going to be really annoyed by 0, a key far to the right, meaning go to the left. But the only vi keystrokes that are assigned by keyboard position rather than meaning are the h/j/k/l navigation keys. Everything else has a meaning-based mnemonic, and until I read your post I hadn't ever thought about their position. I want to press 0, my touch-typing class from my teenage years has drilled that key's location into my hindbrain, so my fingers reach up and press it without thinking about its location at all. The only thing that went through my concious mind was "I want to go to column 0" and then boom, I had typed it.

▲flaunf221 6 minutes ago | parent [-]

> Everything else has a meaning-based mnemonic, and until I read your post I hadn't ever thought about their position

My point is that position is the primary thing that's important for an editor when used for a long time. Your hands and fingers move in physical space, not over alphabet. They get tired and maybe get repetitive strain injuries over real movement.

Mnemomics way of setting up keyboard layout (or rather typewriter) would be to put everything in alphabet order. But we quickly realized that it's not a good way. `d` is where it is because according to (imperfect) research it's a common letter and so in QWERTY layout this letter should be on your home row.

Putting A-something on `a` because the word starts with `a` is not a long term design. Considerations should be based on usage. How often is this used? Put it closer to home row. Is it designed to be often used with another command? If often, those two probably shouldn't be on single finger. And so on.

There is argument for easier start - except that I said already - modal editors are unusable without reading docs first, so that argument doesn't really hold.

▲msdz an hour ago | parent | prev | next [-]

Have you heard of/tried using Helix [0]?

It’s a modal editor, so the basic vi/vim motions are of course there almost by necessity, but then it does a drastic shift to actions that were indeed engineered and thought-through intentionally, instead of being made up long ago and then accepted as gospel (love the analogy, by the way).

It’s now my favorite editor by far (not just because of how you use it to shuffle text around, but that is a big part of it), and has solved many of the gripes I had had with trying not to learn the basics, but getting really “at home” with standard vi/vim/neovim controls.

Your example would be <g-h> and <g-l> instead of 0 and $, which I find highly intuitive: Reuse the known left/right motion for a character, and prepend it with a “goto” to signify the whole line.

[0] https://helix-editor.com, also see default keymap: https://docs.helix-editor.com/keymap.html

▲precompute an hour ago | parent | prev [-]

This is fixable if you introduce another abstraction layer: a small split kb :)

0/$ doesn't matter when they're both one layer down.