Skip to content

Commit ce3d1fb

Browse files
committed
M-x -> Alt-x
1 parent 3af7550 commit ce3d1fb

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

content/en/usage/usage.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight: -50
55

66
This page shows how to use Lem.
77

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).
99

1010
To learn about a specific mode (support for a programming language, the directory mode…) please see the Extensions section on the menu.
1111

@@ -16,15 +16,15 @@ This documentation is improved continually.
1616

1717
## Quickstart
1818

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`).
2020

2121
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`.
2222

2323
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).
2424

2525
To switch buffers: `C-x b`.
2626

27-
To **run an interactive command by name**: `M-x` (`alt-x`).
27+
To **run an interactive command by name**: `Alt-x`.
2828

2929
To show the context menu: `Shift-F10`.
3030

@@ -42,7 +42,7 @@ This pop-up also shows you the associated keybinding of a command.
4242

4343
![](/completion-with-keybindings.png "Interactive completion of commands, showing the keybinding of each function.")
4444

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:
4646

4747
```lisp
4848
(setf lem-core/commands/other:*persist-M-x-commands* nil)
@@ -51,19 +51,19 @@ These M-x commands are persisted across sessions. You can disable it with:
5151
and you can change these parameters:
5252

5353
- `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.
5555

5656
NB: this persistence was added on August, 2025.
5757

5858

5959
## Opening files
6060

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
6262
find-file`). This presents a dialog to choose a file, with
6363
autocompletion, starting at the buffer's directory. We can also search
6464
for files in a **project** or recursively in **subdirectories**.
6565

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.
6767

6868
You can then resize the windows. Look for the "shrink-" and "grow-" commands.
6969

@@ -75,22 +75,22 @@ it. This works with the SDL2 GUI.
7575

7676
> This feature was added in Lem 2.1
7777
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.
7979

8080
<img class="" src="/filer.png" alt="Lem Filer on the left window">
8181

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.
8383

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.
8585

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.
8787

8888

8989
### Project commands
9090

9191
> Project related commands were added in Lem 2.1
9292
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`.
9494

9595
A project is recognized by typical files or directories. For example,
9696
a directory containing a `.git/` subdirectory or a `.project`,
@@ -209,9 +209,9 @@ You can also see them in Lem's dashboard.
209209

210210
### Switching buffers
211211

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`).
213213

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
215215
list-buffers`). You are presented a completion window. Type some text
216216
to start narrowing the buffers list matching your entry. But that's not all.
217217

@@ -226,11 +226,11 @@ A buffer contains some text to display, but is not necessarily tied to a file.
226226
Try using the `C-x b` command and typing the name of a buffer that
227227
doesn't exist. Lem will ask confirmation to create it. If you confirm,
228228
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
231231
C-s` (`save-current-buffer`) doesn't work, saying "No file name". This
232232
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
234234
filename, and saves the buffer to disk.
235235

236236
### Windows
@@ -249,7 +249,7 @@ To make the current window disappear, use `C-x 0` (a zero) (`delete-active-windo
249249

250250
To switch windows (aka splits of a screen), use `C-x o` ('o' letter) or `M-o`.
251251

252-
To switch to the previously active window, use `M-x
252+
To switch to the previously active window, use `Alt-x
253253
switch-to-last-focused-window`, which is not bound to a key by
254254
default.
255255

@@ -271,7 +271,7 @@ For the full list of keybindings please see the [keybindings page](/usage/keybin
271271

272272
On SDL2, Lem is open in a desktop window, which we'll call frame for the context of Lem.
273273

274-
You can programatically call `M-x maximize-frame` and `M-x
274+
You can programatically call `Alt-x maximize-frame` and `Alt-x
275275
minimize-frame`, or bind these commands to key bindings, to make the
276276
frame bigger, or have it minimized.
277277

@@ -280,7 +280,7 @@ frame bigger, or have it minimized.
280280

281281
Lem has a rudimentary support for tabs.
282282

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.
284284

285285
On the GUI version of Lem, you can click on them.
286286

@@ -310,7 +310,7 @@ The frame multiplexer bindings start with `C-z`:
310310

311311
The frame multiplexer is enabled by default. It shows a buffer indicator on the top left corner of the editor.
312312

313-
You can disable it with `M-x toggle-frame-multiplexer`.
313+
You can disable it with `Alt-x toggle-frame-multiplexer`.
314314

315315
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):
316316

@@ -319,7 +319,7 @@ Well, if you want to be sure, add this in your Lem init file (`~/.lem/init.lisp`
319319

320320
## vi and emacs modes
321321

322-
Use `M-x vi-mode` and `M-x emacs-mode`.
322+
Use `Alt-x vi-mode` and `Alt-x emacs-mode`.
323323

324324
You can also start Lem in any given mode by adding this in your init file:
325325

@@ -357,15 +357,15 @@ and in vi-mode:
357357

358358
## Describe keys
359359

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`).
361361

362362
## Describe and list available bindings
363363

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`.
365365

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.
367367

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:
369369

370370
- move, edit, mark, word, S-expressions, file, buffer, window, multiple-cursors, process, help, font and other.
371371

@@ -378,23 +378,23 @@ You can do more and *list all Lem's existing keybindings* with `M-x documentatio
378378

379379
Lem supports recording and playing keyboard macros.
380380

381-
Start recording with `C-x (` (`M-x kbdmacro-start`).
381+
Start recording with `C-x (` (`Alt-x kbdmacro-start`).
382382

383383
Now, press the keys and keyboard shortcuts that you want to replay automatically.
384384

385-
Stop recording with `C-x )` (`M-x kbdmacro-end`).
385+
Stop recording with `C-x )` (`Alt-x kbdmacro-end`).
386386

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`).
388388

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`,
390390
to re-play the macro only in the selected region.
391391

392392

393393
## grep
394394

395-
M-x grep
395+
Alt-x grep
396396

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.
398398

399399
> To set the default args for grep command, put this in your `~/.lem/init.lisp` file.
400400
> ```
@@ -433,19 +433,19 @@ CL-USER> (lem/grep:change-grep-command "git grep")
433433
"git grep -nHI "
434434
```
435435

436-
See also: `M-x project-grep`, bound to `C-x p g`.
436+
See also: `Alt-x project-grep`, bound to `C-x p g`.
437437

438438

439439
## multiple cursors
440440

441-
Use `M-C` (Alt and capital c), `M-x add-cursors-to-next-line` to add a cursor to the next line.
441+
Use `M-C` (Alt and capital c), `Alt-x add-cursors-to-next-line` to add a cursor to the next line.
442442

443443
## opening links
444444

445445
Lem will recognize some forms of links, specifically **URLs** and
446446
**links to files**, and will write them with a special face attribute
447447
(in my case, an underscore). You can open such a link with the command
448-
`M-x open-link` (not bound to a key by default).
448+
`Alt-x open-link` (not bound to a key by default).
449449

450450
- URL: opens your web browser
451451
- file (the link must start with `file://`): Lem opens the file.
@@ -462,7 +462,7 @@ Start legit with:
462462

463463
C-x g
464464

465-
or `M-x legit-status`.
465+
or `Alt-x legit-status`.
466466

467467
Available features are:
468468

@@ -494,7 +494,7 @@ Use `Alt-x claude-code` to connect to a local `claude` server and start a sessio
494494

495495
### Code formatting
496496

497-
Use `M-x format-current-buffer`, or enable auto-formatting like this:
497+
Use `Alt-x format-current-buffer`, or enable auto-formatting like this:
498498

499499
(setf lem:*auto-format* t)
500500

@@ -503,7 +503,7 @@ Formatters are currently defined for c (`clang-format`), go (`gofmt`), js and js
503503

504504
### Color preview
505505

506-
Use: `M-x color-preview` to highlight strings denoting a color (such as "blue" or "#ffffff") in their color.
506+
Use: `Alt-x color-preview` to highlight strings denoting a color (such as "blue" or "#ffffff") in their color.
507507

508508
### Color picker (SDL2)
509509

@@ -529,24 +529,24 @@ Read its documentation on its [dashboard documentation](/modes/dashboard).
529529

530530
### Read-only
531531

532-
Use: `M-x toggle-read-only`
532+
Use: `Alt-x toggle-read-only`
533533

534534
aka `(lem-core/commands/buffer:toggle-read-only)`
535535

536536
### Auto-save
537537

538-
Use: `M-x auto-save-mode`, aka `(lem/auto-save::auto-save-mode t)`.
538+
Use: `Alt-x auto-save-mode`, aka `(lem/auto-save::auto-save-mode t)`.
539539

540540
This one is a global mode: autosave is enabled for all buffers.
541541

542-
You can also use a minor mode: `M-x toggle-auto-save`, aka
542+
You can also use a minor mode: `Alt-x toggle-auto-save`, aka
543543
`(lem/auto-save:toggle-auto-save)`, to enable auto-save for the
544544
current buffer only.
545545

546546

547547
### Full screen
548548

549-
Use: `M-x toggle-frame-fullscreen`
549+
Use: `Alt-x toggle-frame-fullscreen`
550550

551551
### Line highlighting
552552

@@ -564,7 +564,7 @@ color (see `src/highlight-line.lisp`).
564564

565565
### Line numbers
566566

567-
Use: `M-x toggle-line-numbers`
567+
Use: `Alt-x toggle-line-numbers`
568568

569569
or `(lem/line-numbers:toggle-line-numbers)`
570570

@@ -574,7 +574,7 @@ Use `(setf lem/line-numbers:*relative-line* t)` to use relative line numbers (ad
574574

575575
Use the following to turn line wrapping off and on again:
576576

577-
M-x toggle-line-wrap
577+
Alt-x toggle-line-wrap
578578

579579
which you can also do like this in Lisp in your init file:
580580

@@ -601,7 +601,7 @@ to the terminal, so the feature is available in an optional contrib module.
601601

602602
You can try it with:
603603

604-
M-x load-contrib RET mouse-sgr1006 RET
604+
Alt-x load-contrib RET mouse-sgr1006 RET
605605

606606
and now you can click around in windows.
607607

0 commit comments

Comments
 (0)