I am trying to rebalance/distribute the workload from my index and pinky to other fingers but I keep finding modes/contexts in which I still need to use n/p or their modified version C-n/p
in order to achieve what I want, e.g.,
C-c h: helm-org-agenda-files-headings
C-c g a: helm-projectile-ack
magit-status-mode
How can I ensure that all places where n/p are used as key bindings are remapped to the keys I select?
Examples
Basic motion
I have remapped n/p to:
(keymap-global-set "M-J" 'next-line)
(keymap-global-set "M-I" 'previous-line)
This way I can use my index (J) and middle finger (I), avoiding the big stretch from using index (n) and pinky (p). It has the downside that it involves more modifiers but since I use home-row mods, those are also in comfortable locations M(ring)-S(index) so it's not so bad.
Undo
In my layout, I have assigned the Esc key to my right thumb, so doing C-Esc is quite comfortable, compared to the default keys.
(keymap-global-set "C-<escape>" 'undo)
This mapping avoids using:
- C-_ : it requires more keypresses in my custom layout since special symbols like _ are not in the base layer
- C-x u: also more key presses
My current mappings file looks like this: weak-pinky.el
Magit motion
The following mapping follows the same principle, avoid over-extension from using the index (n) and pinky (p) fingers when navigating while in magit-status-mode:
(use-package magit
:ensure t
:bind (:map magit-mode-map
("C-S" . magit-section-backward)
("C-D" . magit-section-forward)
("M-S" . magit-section-backward-sibling)
("M-D" . magit-section-forward-sibling)))
The downside is that it also involves more modifiers, even if they are in comfortable locations:
- n/p becomes
C-S-s/d
- C-n/p becomes
M-S-s/d
Inconsistent motion keys across modes
One thing I don't like is that the keys for basic motion are not the same as those for Magit motion.
Background
I have gathered some data from my keyboard (qwerty layout) use and it turns out that n/p are the two most used keys on my right hand. This matches results from keyfreq and also my subjective experience of pinky pain related to the overstretching from going from n to p and vice-versa.
[C-]n/p
bindings? How do you want to remap such bindings - to what keys? The question lacks detail for what you're trying to do.C-h k (describe-key)
to see what's currently assigned to a keybinding, based on that I can either overwrite it or look for a different one.