Skip to content

Commit d180d47

Browse files
committed
clarify tutorial about plain keys in leader
Common confusion was that plain keys in leader translate to C-<key> when in reality the tutorial meant this only applies to plain keys AFTER a prefix. Hopefully this context-dependent ambiguity has been removed.
1 parent d99fe41 commit d180d47

File tree

2 files changed

+34
-29
lines changed

2 files changed

+34
-29
lines changed

TUTORIAL.org

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,32 @@ The following keys will act according to following rules:
8888

8989
- ~m~ will be translated to ~M-~.
9090
- ~g~ will be translated to ~C-M-~.
91-
- ~SPC~ stands for literal prefix, means the next key will not be modified.
92-
- Any other ~<key>~ will be translated to ~C-<key>~.
93-
- If the translation results in an undefined binding, the last key will fallback to an unmodified version. (e.g. If ~C-c C-a~ is undefined, fallback to ~C-c a~)
91+
- Any key following a prefix like ~m~ or ~g~ is interpreted as
92+
~C-<key>~.
93+
- ~SPC~ stands for literal prefix, means that the key will not be
94+
modified with ~C-~.
95+
- If the translation results in an undefined binding, the last key
96+
will fallback to an unmodified version. (e.g. If ~C-c C-a~ is
97+
undefined, fallback to ~C-c a~)
9498

9599
Some examples(assuming in NORMAL state):
96100

97-
| Input | Translation | Explanation |
98-
|---------------+----------------------+------------------------------|
99-
| ~SPC a~ | ~a~ in leader keymap | |
100-
| ~SPC c t t~ | ~C-c C-t C-t~ | start with ~c~ as ~C-c~ |
101-
| ~SPC x m t~ | ~C-x M-t~ | ~m~ as meta prefix |
102-
| ~SPC g x~ | ~C-M-x~ | ~g~ as control + meta prefix |
103-
| ~SPC x SPC p~ | ~C-x p~ | ~SPC~ as literal prefix |
101+
| Input | Translation | Explanation |
102+
|---------------+----------------------+--------------------------------------------------|
103+
| ~SPC a~ | ~a~ in leader keymap | leader map default is ~mode-specific-map~, ~C-c~ |
104+
| ~SPC c t t~ | ~C-c C-t C-t~ | start with ~c~ as ~C-c~ |
105+
| ~SPC x m t~ | ~C-x M-t~ | ~m~ as meta prefix |
106+
| ~SPC g x~ | ~C-M-x~ | ~g~ as control + meta prefix |
107+
| ~SPC x SPC p~ | ~C-x p~ | ~SPC~ as literal prefix |
104108

105109
*** The leader keymap
106110

107-
By default, the ~mode-specified-map~ will be used as the leader keymap.
108-
This can be change by setting ~meow-keypad-leader-dispatch~.
111+
By default, the ~mode-specific-map~ will be used as the leader keymap.
112+
In practice, this means that your leader keybinds get stored under
113+
~C-c~ and can be accessed as such. Therefore, for instance, ~C-c x~
114+
and ~SPC x~ are identical.
115+
116+
This can be changed by setting ~meow-keypad-leader-dispatch~.
109117

110118
#+begin_src emacs-lisp
111119
;; Some examples

meow-tutor.el

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -590,16 +590,21 @@
590590
Press SPC m h, call the command on M-h, which is
591591
mark-paragraph by default.
592592
593-
3. g will be translated to C-M-, means next input should be
594-
modified with both Control and Meta.
593+
3. Several keys are bound to prefixes similarly. Specifically,
594+
x -> C-x
595+
h -> C-h
596+
c -> C-c
597+
m -> M-
598+
g -> C-M-
595599
596-
Example: g l => C-M-l
600+
4. Any key following a prefix is interpreted as C-<key>.
597601
598-
SPC g l, call the command on C-M-l, which is
599-
reposition-window by default.
602+
Example: x f => C-x C-f
600603
601-
4. A SPC in the middle represent the literal prefix, means
602-
next input should not be modified.
604+
Press SPC x f, call the command on C-x C-f, which is
605+
find-file by default.
606+
607+
5. Use SPC to indicate a literal key, which will not be modified with C-
603608
604609
Example: m g SPC g => M-g g
605610
@@ -608,18 +613,10 @@
608613
609614
Sometimes, you can omit this SPC when there's no ambiguity.
610615
611-
5. For any other cases, the input key will be translated to
612-
C-<key>.
613-
614-
Example: x f => C-x C-f
615-
616-
Press SPC x f, call the command on C-x C-f, which is
617-
find-file by default.
618-
619-
After one execution, no matter succeed or failed, Keypad will
616+
6. After one execution, regardless of success or failure, Keypad will
620617
quit automatically, and the previous mode will be enabled.
621618
622-
To revoke one input, press BACKSPACE. To cancel and exit Keypad
619+
7. To undo one input, press BACKSPACE. To cancel and exit Keypad
623620
immediately, press ESC or C-g.
624621
625622
=================================================================

0 commit comments

Comments
 (0)