You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/usage/usage.md
+45-45Lines changed: 45 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ weight: -50
5
5
6
6
This page shows how to use Lem.
7
7
8
-
You can find a list of available keys and commands in [keybindings](/usage/keybindings/), and you can get this list in Lem itself with `M-x documentation-describe-bindings` (new in Lem 2.1).
8
+
You can find a list of available keys and commands in [keybindings](/usage/keybindings/), and you can get this list in Lem itself with `Alt-x documentation-describe-bindings` (new in Lem 2.1).
9
9
10
10
To learn about a specific mode (support for a programming language, the directory mode…) please see the Extensions section on the menu.
11
11
@@ -16,15 +16,15 @@ This documentation is improved continually.
16
16
17
17
## Quickstart
18
18
19
-
Lem has Emacs-like keybindings, as well as a vi emulation (`M-x vi-mode`).
19
+
Lem has Emacs-like keybindings, as well as a vi emulation (`Alt-x vi-mode`).
20
20
21
21
So, to open a file, press `C-x C-f` (you get the file selection dialog shown above). To save it, it's `C-x C-s`. To save many buffers at once, use `C-x s`.
22
22
23
23
To switch windows (aka splits of a screen): `C-x o` ('o' letter) and `M-o`. To make a window fullscreen: `C-x 1`. To split it vertically: `C-x 3` and horizontally: `C-x 2`. To make the current window disappear: `C-x 0` (zero).
24
24
25
25
To switch buffers: `C-x b`.
26
26
27
-
To **run an interactive command by name**: `M-x` (`alt-x`).
27
+
To **run an interactive command by name**: `Alt-x`.
28
28
29
29
To show the context menu: `Shift-F10`.
30
30
@@ -42,7 +42,7 @@ This pop-up also shows you the associated keybinding of a command.
42
42
43
43

44
44
45
-
These M-x commands are persisted across sessions. You can disable it with:
45
+
These Alt-x commands are persisted across sessions. You can disable it with:
@@ -51,19 +51,19 @@ These M-x commands are persisted across sessions. You can disable it with:
51
51
and you can change these parameters:
52
52
53
53
-`lem-core/commands/other:*history-limit*`: the number of commands that are saved to disk. Defaults to 1000.
54
-
-`lem-core/commands/other:*max-M-x-candidates-from-history*`: the number of saved commands we see at the top when calling M-x. Defaults to 10.
54
+
-`lem-core/commands/other:*max-M-x-candidates-from-history*`: the number of saved commands we see at the top when calling Alt-x. Defaults to 10.
55
55
56
56
NB: this persistence was added on August, 2025.
57
57
58
58
59
59
## Opening files
60
60
61
-
As said above, the shortcut to open a file is `C-x C-f` (aka `M-x
61
+
As said above, the shortcut to open a file is `C-x C-f` (aka `Alt-x
62
62
find-file`). This presents a dialog to choose a file, with
63
63
autocompletion, starting at the buffer's directory. We can also search
64
64
for files in a **project** or recursively in **subdirectories**.
65
65
66
-
You can open a file in another "window", aka if Lem's screen is split in two, open the file in the other screen. Use `C-x 4 f` (`M-x find-file-other-window`). This splits the screen vertically if needed.
66
+
You can open a file in another "window", aka if Lem's screen is split in two, open the file in the other screen. Use `C-x 4 f` (`Alt-x find-file-other-window`). This splits the screen vertically if needed.
67
67
68
68
You can then resize the windows. Look for the "shrink-" and "grow-" commands.
69
69
@@ -75,22 +75,22 @@ it. This works with the SDL2 GUI.
75
75
76
76
> This feature was added in Lem 2.1
77
77
78
-
The shortcut `C-x d` (M-x filer) opens a project explorer on the left side. Another keypress closes the Filer.
78
+
The shortcut `C-x d` (Alt-x filer) opens a project explorer on the left side. Another keypress closes the Filer.
79
79
80
80
<imgclass=""src="/filer.png"alt="Lem Filer on the left window">
81
81
82
-
This command opens the filer at the current working directory. Often, it is the directory from which you started Lem. You can change it (M-x change-directory), but you can use other filer commands.
82
+
This command opens the filer at the current working directory. Often, it is the directory from which you started Lem. You can change it (Alt-x change-directory), but you can use other filer commands.
83
83
84
-
The command `M-x filer-directory` opens (or closes) the filer at the current buffer's directory.
84
+
The command `Alt-x filer-directory` opens (or closes) the filer at the current buffer's directory.
85
85
86
-
The command `M-x filer-at-directory` prompts you for a directory. It is new as of November 2024.
86
+
The command `Alt-x filer-at-directory` prompts you for a directory. It is new as of November 2024.
87
87
88
88
89
89
### Project commands
90
90
91
91
> Project related commands were added in Lem 2.1
92
92
93
-
Use `M-x project-find-file` to choose a file among the list of all files pertaining to the current project. This command is bound to `C-x p f`.
93
+
Use `Alt-x project-find-file` to choose a file among the list of all files pertaining to the current project. This command is bound to `C-x p f`.
94
94
95
95
A project is recognized by typical files or directories. For example,
96
96
a directory containing a `.git/` subdirectory or a `.project`,
@@ -209,9 +209,9 @@ You can also see them in Lem's dashboard.
209
209
210
210
### Switching buffers
211
211
212
-
To switch buffers, use `C-x Left/Right arrow` (aka `M-x previous-buffer` and `next-buffer`).
212
+
To switch buffers, use `C-x Left/Right arrow` (aka `Alt-x previous-buffer` and `next-buffer`).
213
213
214
-
To choose a buffer interactively, use `C-x b` (aka `M-x
214
+
To choose a buffer interactively, use `C-x b` (aka `Alt-x
215
215
list-buffers`). You are presented a completion window. Type some text
216
216
to start narrowing the buffers list matching your entry. But that's not all.
217
217
@@ -226,11 +226,11 @@ A buffer contains some text to display, but is not necessarily tied to a file.
226
226
Try using the `C-x b` command and typing the name of a buffer that
227
227
doesn't exist. Lem will ask confirmation to create it. If you confirm,
228
228
you'll get a buffer that is not tied to a file on your filesystem. You
229
-
can write whatever you want, as well as enable a major mode (`M-x
230
-
lisp-mode`, `M-x markdown-mode`…). You'll note that the command `C-x
229
+
can write whatever you want, as well as enable a major mode (`Alt-x
230
+
lisp-mode`, `Alt-x markdown-mode`…). You'll note that the command `C-x
231
231
C-s` (`save-current-buffer`) doesn't work, saying "No file name". This
232
232
is correct, no file is associated to this buffer. To save this buffer
233
-
to a new file, use `C-x C-w` (`M-x write-file`). It asks for a
233
+
to a new file, use `C-x C-w` (`Alt-x write-file`). It asks for a
234
234
filename, and saves the buffer to disk.
235
235
236
236
### Windows
@@ -249,7 +249,7 @@ To make the current window disappear, use `C-x 0` (a zero) (`delete-active-windo
249
249
250
250
To switch windows (aka splits of a screen), use `C-x o` ('o' letter) or `M-o`.
251
251
252
-
To switch to the previously active window, use `M-x
252
+
To switch to the previously active window, use `Alt-x
253
253
switch-to-last-focused-window`, which is not bound to a key by
254
254
default.
255
255
@@ -271,7 +271,7 @@ For the full list of keybindings please see the [keybindings page](/usage/keybin
271
271
272
272
On SDL2, Lem is open in a desktop window, which we'll call frame for the context of Lem.
273
273
274
-
You can programatically call `M-x maximize-frame` and `M-x
274
+
You can programatically call `Alt-x maximize-frame` and `Alt-x
275
275
minimize-frame`, or bind these commands to key bindings, to make the
276
276
frame bigger, or have it minimized.
277
277
@@ -280,7 +280,7 @@ frame bigger, or have it minimized.
280
280
281
281
Lem has a rudimentary support for tabs.
282
282
283
-
Activate the tab bar with `M-x toggle-tabbar`. This shows a tab for every buffer.
283
+
Activate the tab bar with `Alt-x toggle-tabbar`. This shows a tab for every buffer.
284
284
285
285
On the GUI version of Lem, you can click on them.
286
286
@@ -310,7 +310,7 @@ The frame multiplexer bindings start with `C-z`:
310
310
311
311
The frame multiplexer is enabled by default. It shows a buffer indicator on the top left corner of the editor.
312
312
313
-
You can disable it with `M-x toggle-frame-multiplexer`.
313
+
You can disable it with `Alt-x toggle-frame-multiplexer`.
314
314
315
315
Well, if you want to be sure, add this in your Lem init file (`~/.lem/init.lisp` or `~/.config/lem/init.lisp` since Lem 2.2):
316
316
@@ -319,7 +319,7 @@ Well, if you want to be sure, add this in your Lem init file (`~/.lem/init.lisp`
319
319
320
320
## vi and emacs modes
321
321
322
-
Use `M-x vi-mode` and `M-x emacs-mode`.
322
+
Use `Alt-x vi-mode` and `Alt-x emacs-mode`.
323
323
324
324
You can also start Lem in any given mode by adding this in your init file:
325
325
@@ -357,15 +357,15 @@ and in vi-mode:
357
357
358
358
## Describe keys
359
359
360
-
To know what function is bound to a key binding, use `C-x ?` (`M-x describe-key`).
360
+
To know what function is bound to a key binding, use `C-x ?` (`Alt-x describe-key`).
361
361
362
362
## Describe and list available bindings
363
363
364
-
To see the available key bindings in the current keymap, use `M-x describe-bindings`.
364
+
To see the available key bindings in the current keymap, use `Alt-x describe-bindings`.
365
365
366
-
You can use `M-x describe-mode` to understand in which mode the editor is in the current buffer.
366
+
You can use `Alt-x describe-mode` to understand in which mode the editor is in the current buffer.
367
367
368
-
You can do more and *list all Lem's existing keybindings* with `M-x documentation-describe-bindings`. It inspects Lem and lists keybindings, grouped by modes:
368
+
You can do more and *list all Lem's existing keybindings* with `Alt-x documentation-describe-bindings`. It inspects Lem and lists keybindings, grouped by modes:
369
369
370
370
- move, edit, mark, word, S-expressions, file, buffer, window, multiple-cursors, process, help, font and other.
371
371
@@ -378,23 +378,23 @@ You can do more and *list all Lem's existing keybindings* with `M-x documentatio
378
378
379
379
Lem supports recording and playing keyboard macros.
380
380
381
-
Start recording with `C-x (` (`M-x kbdmacro-start`).
381
+
Start recording with `C-x (` (`Alt-x kbdmacro-start`).
382
382
383
383
Now, press the keys and keyboard shortcuts that you want to replay automatically.
384
384
385
-
Stop recording with `C-x )` (`M-x kbdmacro-end`).
385
+
Stop recording with `C-x )` (`Alt-x kbdmacro-end`).
386
386
387
-
And now, re-play your key combination with `C-x e` (`M-x kbdmacro-execute`).
387
+
And now, re-play your key combination with `C-x e` (`Alt-x kbdmacro-execute`).
388
388
389
-
Another command you might want to use is `M-x apply-macro-to-region-lines`,
389
+
Another command you might want to use is `Alt-x apply-macro-to-region-lines`,
390
390
to re-play the macro only in the selected region.
391
391
392
392
393
393
## grep
394
394
395
-
M-x grep
395
+
Alt-x grep
396
396
397
-
this presents the results in a two-panes window. You can edit lines in the results buffer, changes are reflected immediately on the files, and updated on the right side. You can use search and replace `M-x query-replace` in the results buffer.
397
+
this presents the results in a two-panes window. You can edit lines in the results buffer, changes are reflected immediately on the files, and updated on the right side. You can use search and replace `Alt-x query-replace` in the results buffer.
398
398
399
399
> To set the default args for grep command, put this in your `~/.lem/init.lisp` file.
0 commit comments