←back to thread

539 points todsacerdoti | 8 comments | | HN request time: 0.001s | source | bottom
Show context
robenkleene ◴[] No.44358285[source]
I love this, I've been iterating on workflows like this for something like a decade now. Over time I've tried to peel back as many of my custom layers as possible, because all of those layers have a maintenance cost.

Stock Vim (without `tmux`) can actually do most of what's shared in this post with `rg --vimgrep restore_tool | vim -c cb -` (`vim -c cb -` is my favorite feature in Vim; I find it strange that it's so rarely used or talked about).

(Since re-running the `rg` search can be undesirable, and I often like to analyze results in a terminal before opening them in Vim. I use a custom `tmux` command to copy the output of the last command [using this trick that involves adding a Unicode character to your prompt https://ianthehenry.com/posts/tmux-copy-last-command/], then I send that into Vim with e.g., `tmux saveb - | vim -c cb -`.)

replies(7): >>44358653 #>>44358736 #>>44360925 #>>44362611 #>>44363893 #>>44364510 #>>44403351 #
msgodel ◴[] No.44358736[source]
Ten years ago I threw out my massive multi-file, multi-package vim config and have been slowly building up a much simpler vimrc about 1-2 lines a year. I completely agree, defaults in old software are almost always there for a reason and you should try to understand that before changing them.
replies(6): >>44359927 #>>44360624 #>>44361137 #>>44362231 #>>44363110 #>>44363602 #
eviks ◴[] No.44363110[source]
That would be true if you had universally great designers back then, which wasn't the case, thus the defaults are universally bad, so it's a bad heuristic to stick to them and force a waste in trying to understand them.

For example, why is the default vim cursor hjkl? Well, it's just that the arrows on the physical keyboard of one of the vim designers were drawn there. That's it. There is no deep thought in search of the best cursor position, and understanding the why is just learning a useless piece of trivia.

replies(5): >>44363298 #>>44363634 #>>44363864 #>>44364112 #>>44364424 #
sakjur ◴[] No.44363298{3}[source]
That seems quite harsh. Just because the designers aren’t perfect doesn’t mean the design is universally bad.

To address your example: Why were the arrow keys on those particular keys? Who put them there? hjkl are on the home row, and touch typists end up having the movement keys under their right hand’s resting fingers. That’s suddenly quite convenient.

replies(3): >>44363377 #>>44363972 #>>44365532 #
1. bluebarbet ◴[] No.44363972{4}[source]
As pointed out, this is wrong. What touch-typists want is jkl;, because the right home key is j. This is an absolutely necessary config change in vanilla vim, unfortunately.
replies(3): >>44364451 #>>44364846 #>>44368316 #
2. myfonj ◴[] No.44364451[source]
For me personally is the J/K direction still feels swapped and I always have to remind myself they are in fact the other way round. Even (especially) for touch typists, I would really expect [k] to point down and [j] up. In our writing system from the top left to bottom right my intuition would really be to stick ↑ with ← together and vice versa ↓ with →.

    ← ↓ ↑ →
makes a little sense to me.

    ← ↑ ↓ →
would be way better, IMO.

Not only because the most used used direction (↓) would be closer to my "neutral" finger position, but mainly because the the keys for progressing "back" and keys for progressing "forwards would be grouped together.

Honestly, I wouldn't even mind having them spread across two rows, like U I J K

    ↑  ↓
    ←  →
or something. (Personally, I have global WASD-like arrow mapping bound to IJKL through capslock combo in AutoHotkey, since sometimes cursor keys are really inconveniently far away when typing.)
replies(1): >>44374589 #
3. skydhash ◴[] No.44364846[source]
I like the bindings, because I move vertically more than I move, so I want my strongest (other than the thumb) there. And I move to the right more than I do to the left. So I don’t mind moving my finger to do the latter.
replies(1): >>44365792 #
4. SirHumphrey ◴[] No.44365792[source]
It may be different based for others based on hand anatomy, but at least for me the index finger is so much stronger than the little finger, that it feels more comfortable moving it one space to the left, especially on keyboards with heavy keys (like model M).
replies(1): >>44370958 #
5. esoterae ◴[] No.44368316[source]
As a touch typist that learned decades before learning vi, with Emacs in the middle, I can definitively say your blanket statement is false. And as a recovering Emacs user, I can also say the little finger thing for a repetitive key is a dangerous proposition with real potential health drawbacks.
6. bluebarbet ◴[] No.44370958{3}[source]
I will admit that I had never considered things like this (there's a couple of you making a similar point). It's a decent argument. Maybe I'll revert to the default and see if I can handle the change.
7. lIl-IIIl ◴[] No.44374589[source]
I think the current system is the way it is in order so that the most used direction (down) uses your strongest finger, the index finger.

I don't know what your mean by "Not only because the most used used direction (↓) would be closer to my "neutral" finger position" - what is your neutral finger position?

I also got lost in the sentence about "back" and "forwards" - what is back and forwards?

replies(1): >>44386263 #
8. myfonj ◴[] No.44386263{3}[source]
> what is back and forwards?

Sorry, I didn't realise that was unclear. By "back" and "forwards", I mean movement through the flow of text relative to the cursor position. Given any reference point in linear text, all surrounding content either precedes or follows that point. Moving through preceding content is "going back", and moving through following content is "going forwards". When we move to the preceding line (↑) or preceding character (←), we're going "back". When we move to the following line (↓) or following character (→), we're moving "forwards". My point was that ← ↓ ↑ → effectively represents "back one character — forward one line — back one line — forward one character", which feels counter-intuitive to me.

> strongest finger, the index finger.

Interesting. As far as I now, middle finger is usually considered stronger than the index finger. Index finger might be more dextrous, though (?). Personally, I also slightly prefer the middle finger for rapid pressing over the index finger, but cannot see strong definitive advantage of either one. (I guess most of us use the middle finger for regular ↑↓ keys, as well as W/S in WASD bindings in games/project just fine, and using index finger in that context instead would feel odd.)

> what is your neutral finger position?

Mostly index finger on "K". (So I guess I'd prefer having "down" (being the most frequently used when VIM binding is involved) on "L", where my middle finger usually dwells, and "K" for moving up, if I had to invent it from scratch.)