Skip to content

Commit 129cbf0

Browse files
committed
docs: reformat readline help page with tables and external link
Replace raw text dump with clean grouped tables for navigation, editing, kill/yank, history, and completion. Link to GNU Readline User Manual instead of duplicating reference details. Add tags and see-also bar.
1 parent 4e736fc commit 129cbf0

1 file changed

Lines changed: 76 additions & 46 deletions

File tree

docs/cli/helpreadline.md

Lines changed: 76 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,79 @@
1-
# Readline Input Keys
2-
3-
4-
The command line interface (CLI) uses readline to take input command for keyboard. Readline offers convenient bindings, listed in this page.
5-
6-
For more information, consult the readline library documentation.
7-
8-
9-
```text
10-
11-
READLINE QUICK HELP
12-
13-
14-
Notations:
15-
C- is control key
16-
M- is meta key (if already bound to action, use ESC and then type the following character)
17-
18-
C-_ or C-x C-u Undo the last editing command. You can undo all the way back to an empty line.
19-
C-a Move to the start of the line
20-
C-e Move to the end of the line
21-
M-f Move forward a word, where a word is composed of letters and digits.
22-
M-b Move backward a word.
23-
C-l Clear the screen, reprinting the current line at the top.
24-
25-
C-k Kill the text from the current cursor position to the end of the line.
26-
M-d Kill from the cursor to the end of the current word, or, if between words, to the end of the next word.
27-
M-DEL Kill from the cursor the start of the current word, or, if between words, to the start of the previous
28-
C-w Kill from the cursor to the previous whitespace. This is different than M-DEL because the word boundaries differ.
29-
30-
C-y Yank the most recently killed text back into the buffer at the cursor.
31-
M-y Rotate the kill-ring, and yank the new top. You can only do this if the prior command is C-y or ESC y.
32-
33-
M-< Move to the first line in the history.
34-
M-> Move to the end of the input history, i.e., the line currently being entered.
35-
36-
C-t Drag the character before the cursor forward over the character at the cursor, moving the cursor forward as well. If the insertion point is at the end of the line, then this transposes the last two characters of the line. Negative arguments have no effect.
37-
M-t Drag the word before point past the word after point, moving point past that word as well. If the insertion point is at the end of the line, this transposes the last two words on the line.
38-
M-u Uppercase the current (or following) word. With a negative argument, uppercase the previous word, but do not move the cursor.
39-
M-l Lowercase the current (or following) word. With a negative argument, lowercase the previous word, but do not move the cursor.
40-
M-c Capitalize the current (or following) word. With a negative argument, capitalize the previous word, but do not move the cursor.
41-
42-
TAB Attempt to perform completion on the text before point. The actual completion performed is application-specific. The default is filename completion.
43-
M-? List the possible completions of the text before point.
44-
M-* Insert all completions of the text before point that would have been generated by possible-completions.
1+
---
2+
tags:
3+
- cli
4+
---
455

46-
```
6+
# Readline Keyboard Shortcuts
7+
8+
The milk CLI uses the
9+
[GNU Readline](https://tiswww.case.edu/php/chet/readline/rltop.html)
10+
library for line editing. This page lists the most
11+
useful keybindings.
12+
13+
> [!TIP]
14+
> For the complete reference, see the official
15+
> [Readline User Manual](https://tiswww.case.edu/php/chet/readline/readline.html).
16+
17+
See also: [CLI Overview](CLI_Overview.md) ·
18+
[CLI Syntax](CLIcore.md) · [Scripting](scripting.md)
19+
20+
## Notation
21+
22+
| Prefix | Meaning |
23+
|--------|---------|
24+
| `C-x` | Hold **Ctrl** and press **x** |
25+
| `M-x` | Hold **Alt/Meta** and press **x** (or press **Esc** then **x**) |
26+
27+
## Navigation
28+
29+
| Key | Action |
30+
|-----|--------|
31+
| `C-a` | Move to start of line |
32+
| `C-e` | Move to end of line |
33+
| `M-f` | Move forward one word |
34+
| `M-b` | Move backward one word |
35+
| `C-l` | Clear screen, reprint current line |
36+
37+
## Editing
38+
39+
| Key | Action |
40+
|-----|--------|
41+
| `C-_` / `C-x C-u` | Undo last edit |
42+
| `C-t` | Transpose characters |
43+
| `M-t` | Transpose words |
44+
| `M-u` | Uppercase current word |
45+
| `M-l` | Lowercase current word |
46+
| `M-c` | Capitalize current word |
47+
48+
## Kill & Yank (Cut & Paste)
49+
50+
| Key | Action |
51+
|-----|--------|
52+
| `C-k` | Kill from cursor to end of line |
53+
| `C-w` | Kill previous word (whitespace-delimited) |
54+
| `M-d` | Kill from cursor to end of word |
55+
| `M-DEL` | Kill from cursor to start of word |
56+
| `C-y` | Yank (paste) most recently killed text |
57+
| `M-y` | Rotate kill-ring after `C-y` |
58+
59+
## History
60+
61+
| Key | Action |
62+
|-----|--------|
63+
| `` / `C-p` | Previous history entry |
64+
| `` / `C-n` | Next history entry |
65+
| `C-r` | Reverse incremental search |
66+
| `M-<` | Jump to first history entry |
67+
| `M->` | Jump to last (current) entry |
68+
69+
## Completion
70+
71+
| Key | Action |
72+
|-----|--------|
73+
| `TAB` | Autocomplete (commands, filenames) |
74+
| `M-?` | List possible completions |
75+
| `M-*` | Insert all completions |
4776

4877
---
49-
[Documentation Index](../index.md)
78+
[CLI Overview](CLI_Overview.md) ·
79+
[Documentation Index](../index.md)

0 commit comments

Comments
 (0)