Skip to content

Commit c57f6ec

Browse files
committed
add transient.md
1 parent f0b7b12 commit c57f6ec

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

content/en/usage/transient.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Transient help popup
3+
weight: -30
4+
---
5+
6+
A transient is a text pop-up window, displaying at the bottom of the
7+
screen, that shows keybindings and their associated commands.
8+
9+
The pop-up can stay in place when the user presses a key, which allows
10+
to always show help on-screen.
11+
12+
## Simple example
13+
14+
```lisp
15+
(define-command example-command () ()
16+
(message "example message"))
17+
18+
(lem/transient:define-transient *demo-keymap-simple*
19+
:description "my demo keymap"
20+
(:key "a" :suffix 'example-command :description "demo prefix 1")
21+
(:key "b" :suffix 'example-command :description "demo prefix 2" :active-p nil))
22+
23+
(define-key *global-keymap* "C-c t" *demo-keymap-simple*)
24+
```
25+
26+
<div style="text-align: center;"> <img src="https://raw.githubusercontent.com/lem-project/lem/main/extensions/transient/transient-simple.png"/> </div>
27+
28+
## Show all current keybindings
29+
30+
Setting `lem/transient:*transient-always-show*` to `t` makes it show
31+
all available keybindings for the current mode(s):
32+
33+
```lisp
34+
(setf lem/transient::*transient-always-show* t)
35+
```
36+
37+
<div style="text-align: center;"> <img src="https://raw.githubusercontent.com/lem-project/lem/main/extensions/transient/transient-simple.png"/> </div>

0 commit comments

Comments
 (0)