27 October 2020 - Fingers on the Home Row
We interact with our tools through typing, pointing/clicking and shortcuts. Here’s a simple challenge: are you able to imagine what going keyboard-only looks like? Let’s confront.
There are things you don’t want to know you can do.
— Robin McKinley, Sunshine
So let’s think together: What does going keyboard-only look like?
The Home Row
YourF
and J
keys are special. If you look closely at them, you should see some sort of markers.
Why?
Well, because if you are using a keyboard, you are supposed to have your index fingers placed on F
and J
in order to be able to reach all keys with the least effort.
It is the first thing that touch typists (people who can type without looking at their keyboard) learn, followed by learning which finger should go to which key.
When you use your keyboard that way, you’ll notice that your fingers do all the work from muscle memory and your hands should almost not move.
Personally, I find that one key difference between using a mouse and using the keyboard is that:
- Using the mouse, I feel in a position where I have to reach an element on the screen
- Using the keyboard, I feel in a position where I immediately press a key
Usually, I feel more proactive and in control with a keyboard whereas I feel more guided with a mouse.
Item selection, but without the mouse
Because our tools are suited to the mouse & keyboard paradigm, trying to select items without a mouse cannot feel natural.
Let me list 4 selection workflows you might find yourself using when going full-keyboard.
Fuzzy Finding
A fuzzy finder is a program that takes a list of strings as input, and allows you to select one or several of its items through fuzzy search.
What’s fuzzy search you ask?
Here’s a small showcase:
You’ll see:
- queries that I’m typing (
omnilang
,omnilog
,bujson
andendex
) - elements “matching” my query, i.e. “the characters in the query appear at some point in the item, in the same order”
- I’m using file paths in this particular example but it could be any list of strings
- git commits would work
- file templates would work
- your own custom list of strings would work
- I can also customize the action triggered on the currently selected item when I press
Enter
There are several fuzzy finders out there - I’m using fzf. This video goes more into details with how you can use that amazing utility:
Click-to-shortcut transformation
Sometimes you have to stick with a visual representation of things (web browsers, for instance). In that case you can use something like vimium - the hacker’s browser:
Pressing one key allows you to display all the links you could otherwise click on, and attach a shortcut that simulates a click.
More basic things
While the previous examples require some sort of program or script, other ways are out-of-the-box, such as global searching and good old autocompletion:
About the ergonomics of your keyboard…
The truth is, keyboards suffer from some design issues…
- Some keys are placed very close to your fingers but rarely used (I’m looking at you,
Caps Lock
). - Some are going to located at different places depending on the laptop or keyboard you’re looking at (
Delete
,Home
,End
,Up
/Down
/Left
/Right
) - Some even have different shapes from a keyboard to another(
Enter
, anyone?).
For this reason, I created the following remappings for myself using autohotkey (Windows only):
Original key | Mapped to… |
---|---|
Esc |
CapsLock (pressed) |
Ctrl |
CapsLock (held down) |
Enter |
CapsLock +m |
§ |
“focus my IDE’s window” |
Tab |
CapsLock +i |
Shift +Tab |
CapsLock +o |
Backspace |
CapsLock +h |
Delete |
CapsLock +l |
Enter |
CapsLock +m |
Up |
CapsLock +p |
Down |
CapsLock +n |
Left |
CapsLock +j |
Right |
CapsLock +k |
Home |
^ +j |
End |
^ +k |
AltGr +alphanumKey |
^ + consonantLetter |
I’m using a French azerty keyboard ; here’s the gist behind these mappings:
Esc
andCtrl
are too far from my fingers. I’m usingCapsLock
.Tab
is too far from my left pinky. I’m usingCapsLock
+i
.- I have accessible mappings for arrows,
Home
,End
,Backspace
andDelete
. - I need to move my right hand to reach
Enter
, whereasCapsLock
+m
requires zero hand movement. - I have never used
§
in 28 years. So I remapped it to something useful: putting the focus on my IDE. - I have never used
^
followed by a consonant letter either. I hateAltGr
so I remapped allAltGr
combinations with^
instead.
You can find my autohotkey script here!
Text edition
I’m dedicating next post for this topic, and most likely a series of other ones… The topic is vast, and it has one hell of a big name : vim - the ubiquitous text editor