Skip to content

Commit a7e4c53

Browse files
committed
configuration: meta prefix keys
1 parent b9aece7 commit a7e4c53

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

content/en/usage/configuration.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,35 @@ And now we can define the prefix key for our keymap and all its sub-keys command
151151

152152
As a result, we defined `C-z c` for `'frame-mulitplexer-create-with-new-buffer-list`.
153153

154+
### Change the Alt (Meta) key
155+
156+
The editor variable `meta-prefix-keys` allows to treat keys as the Meta (Alt) prefix without timeout.
157+
158+
- when enabled, pressing a prefix key followed by another key produces Meta+key immediately
159+
- pressing the same prefix key twice produces the prefix key itself
160+
- implemented in core layer, works across all frontends
161+
162+
Example:
163+
164+
```lisp
165+
;; Use Escape as Meta prefix (simplest)
166+
(setf (lem:variable-value 'lem:meta-prefix-keys :global) t)
167+
168+
;; Use a specific key as Meta prefix
169+
(setf (lem:variable-value 'lem:meta-prefix-keys :global)
170+
(lem:make-key :ctrl t :sym ";"))
171+
172+
;; Use multiple keys as Meta prefix
173+
(setf (lem:variable-value 'lem:meta-prefix-keys :global)
174+
(list (lem:make-key :sym "Escape")
175+
(lem:make-key :ctrl t :sym ";")))
176+
```
177+
178+
| Input | Output |
179+
|-------|--------|
180+
| Escape x | M-x |
181+
| Escape Escape | Escape |
182+
| Escape C-c | M-C-c |
154183

155184
## Undefining keys
156185

0 commit comments

Comments
 (0)