Introduction
Do you think typing fast, i.e., achieving a high wpm (high word-per-minutes), is the only way to be efficient/productive? If you do, then this compact, 5-mins read post will blow your mind, making you even faster.1
Mentality
What I'm going to share is not about how you can be fast in regular typesetting, e.g., achieving wpm 150 in monkeytype. Rather, it's about some of the most fundamental editing-related key remaps I have done.
If you have read the post about VSCode-LaTeX-Inkscape and are still wondering how I can typeset these notes in class, here it is: this is my only secret left.
Before walking through my key remaps one by one, I want to give you the mentality you should have when adapting my settings: Your hands should move as little as possible. You might already hear this multiple times, but you should bring this to an extreme, i.e., staying your hand on the main row (i.e., right index finger on f
, left index finger on j
) is the bare minimum you should achieve.
Let me ask you: How do you typically delete a character? If you
use delete
(backspace
) with your right little finger traveling across 2 columns and 2 rows,
then you should keep reading.
Tool matters
First thing first, please get yourself a good keyboard. I use HHKB Professional Hybrid Type-S personally. It's fast, elegant, and customizable. Moreover, the revolutionary layout is awesome.2
The Setup
I will use macOS and Karabiner-Elements as our working example, but the same concept should be easily ported to other operating systems. The following is a snapshot of my setting.
You can easily import these settings at the end, which can be used as your own setting's starting point. Now, let's walk through them one by one.
right cmd
Use Have you ever used your right cmd
?
Arrow Keys
I hope you use Vim, or at least heard about it. If you're introducing Vim to others, the first thing you might say is that
instead of using ←
/↓
/↑
/→
, we now use h
/j
/k
/l
(in normal mode)!
Now the question is, WHY? Well, imagine you're editing texts, and want to change something 3 characters before the cursor, what should you do? Using arrow keys would be a natural choice if you're not in Vim. But remember that your arrow keys are far away from the main row of your keyboard.
To address this, we simply adapt Vim's solution, i.e., using h
/j
/k
/l
as arrow keys. However, unlike in Vim where we have normal mode and insert mode, using h
/j
/k
/l
as arrow keys in normal mode would not be a problem. Contrarily, we now need to maintain the ability to insert alphabets h
/j
/k
/l
. The solution is also simple: use a modifier. I use right cmd
+h
/j
/k
/l
as ←
/↓
/↑
/→
.
You might notice that I use the right cmd
instead of just cmd
. This is because cmd
+h
/j
/k
/l
might be your other shortcuts, and entirely overloading them to arrow keys is not ideal. Hence, by specifying only right cmd
+h
/j
/k
/l
as arrow keys, it
- preserve the potential shortcuts; and
right cmd
+h
/j
/k
/l
only uses your right hand which is very natural (you just need to press theright cmd
with your right thumb, and you can use arrow keys just like you're in Vim wherever you are).
Math-Related Characters
We saw that you can use your right cmd
as a special modifier, and now we want to extend this theme. I typeset math-related characters quite often, e.g., =
, +
/-
, ^
/_
, (
/)
, [
/]
, and {
/}
. Most of them are on the top row and need a modifier (usually shift
). And this is not very intuitive and still, some of them (e.g., +
/=
and -
/_
) are far from the main column (w.r.t. your little finger) and the main row. So, I use
right cmd
+g
for=
;right cmd
+e
/c
for+
/-
;right cmd
+r
/v
for^
/_
;right cmd
+d
/f
for(
/)
;right cmd
+a
/s
for{
/}
;right cmd
+q
/w
for[
/]
;
Here is my justification for this setup:
- It's easy to type: All of them are around the main row of your left hand (and your right hand is only responsible for the
right cmd
). - It's easy to remember: They're quite symmetric (e.g.,
^
isright cmd
+r
while_
isright cmd
+v
, up and down, respectively). - It's more accurate: It's not easy to type
-
/_
and+
/=
on the first try with your right little finger in the ordinary setup. - It's more comfortable: The most frequently used characters, i.e.,
^
/_
and+
/-
, are configured to your index finger and middle finger, respectively.
Long and Short Press
If you notice that some keys are only designed for long-press but never exploit it, then keep reading.
Escape
Again, if you use Vim, then you will need to use esc
intensively. Hence, some might suggest you remap the caps lock
to esc
.
However, in my case, I'm using HHKB, i.e., the usual position for caps lock
is control
.
To make thing consistent, I also remap
caps lock
on my MacBook tocontrol
.
So, should we directly remap control
to esc
? No! Observe that control
is used as a modifier, i.e., you never click control
on its own. By exploiting this fact, we can
set control
to be esc
if it's pressed alone.
Specifically, if I press control
for less than a threshold called alone threshold
(e.g., 0.15 seconds), then it'll be recognized as esc
; and if I press control
for more than a threshold called hold-down threshold
(e.g., 0.04 seconds), then it'll be recognized as control
and can then be used as a modifier.3
Left and Right Shift
Now we know we can use long press and single press separately, we can overload other modifiers in the same way as well! I do not go all the way to overload every modifier however; I only overload both shift
s besides control
.
You might not want to do this for every modifier such as
opt
andcmd
to be honest... It's very possible that you will accidentally trigger them when you're trying out what shortcut you're going to use (e.g., when you're copying things usingcmd
+c
, it's possible to presscmd
alone and release it when you realize you don't want to actually copy the selected texts).
For the left shift
, I configure it as
caps lock
when left shift
is pressed alone.
This is because I'm bilingual, and I need to be able to switch the input language on the fly (actually the macOS default caps lock
is the fastest way to switch the input language in my experience). So, I leave it as it is on the system level, and modify the left shift
to be caps lock
when it's pressed alone. It works quite well in practice.
For the right shift
, I do something more crazy:
when right shift
is pressed alone, it acts as delete
is pressed alone
and,
when right shift
is pressed twice and is held on the second press, it acts as delete
is held down.
The first one is clear: I don't want to reach my little finger to the usual delete
spot since it's far away4, and it's natural to remap delete
to the right shift
since it's an easy reach for my right little finger.
But there's a problem: you now can't hold delete
for a consecutive deletion since holding it is equivalent to holding the right shift
. To fix this, I come up with the above-mentioned solution, that is, you can trigger the hold-down action for deletion
by
- pressing
right shift
alone first, and - pressing
right shift
again and holding it.
Intuitive, right? That's all I want to share.
Import Settings
To import others' settings in Karabiner-Elements, I don't know any easy (i.e., 1-click) way to do it. But the basic steps are as follows.
- Open Karabiner-Elements, go to Misc and click on Export & Import.
- Copy
Alone.json
,Double.json
,Right-Cmd.json
into.config/karabiner/assets/complex_modifications
.5 - Again open Karabiner-Elements, go to Complex Modifications and click on Add rule.
- You should be able to enable these rules easily.
Finally, you can also set up your Parameters as mine:
- In the sense of efficiency, go without saying.↩
- If you're interested in learning more about HHKB, go to hhkb.io.↩
- You might notice that it's possible to have conflict, i.e., if you press
control
for 0.1 seconds, then it'll trigger bothcontrol
andesc
. However, it's fine sincecontrol
is a modifier but is not combined withesc
. You don't want yourhold-down threshold
to be too long (e.g., 0.15 seconds to avoid conflict) because then whenever you want to usecontrol
as a modifier combined with other keys to trigger a shortcut, you'll need to holdcontrol
for that long.↩ - Also, on the HHKB layout, the
delete
key is on the usual|
/\
key's spot, which is quite awkward for me. So I remap thedelete
on my HHKB to|
/\
on the system level; this means, thedelete
key is now completely gone on my HHKB.↩ - If you came from VSCode-LaTeX-Inkscape, then you add
Inkscape.json
into.config/karabiner/assets/complex_modifications
.↩