This is an automated archive made by the Lemmit Bot.

The original was posted on /r/vim by /u/_barjo on 2023-10-09 01:14:03.


Say you’re typing this: “function(foo)”. Pretty common set of characters to write, the way in which “function” is written is ubiquitous, but how people approach the typing of “(foo)” can differ in a few ways.

Option 1: (foo)

Option 2: ()ifoola

Option 3: ()foo

Option 4: ( foola

For me, I’m strongly in the option 2 camp. I use this for all brackets and quotes, and always have done. It’s exactly 5 more keystrokes than option 1 (often I’ll use “A” instead of “la” when I’m writing the line, which takes it to 4), but there’s some advantages of option 1 which is why I use it (as well as old habits die hard).

Both hands need to move off the home row to enter a bracket, one for shift and one for the bracket itself, which is quite a costly move. This needs to be done twice in option 1, however in option 2, both brackets are entered pretty much at the same time, you roll from one to the next since they’re next to each other, while the left hand stays stationary on shift. For this reason it feels like a single keystroke, because rolling from one bracket to the next is almost like pressing a single key. And it categorically uses one less shift keypress than option 1, but who’s counting. A strong advantage is when entering brackets inside brackets, you never need to worry about keeping track of which brackets have been left open, by using option 2 you are closing all brackets as you go along.

I’m keen to hear what others’ preferred option is and why ⌨️