Skip to content

Commit 4930735

Browse files
committed
Improve text editor data
1 parent 3cca5ce commit 4930735

11 files changed

Lines changed: 498 additions & 283 deletions

File tree

assets/basics/emacstexteditor.md

Lines changed: 82 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,86 @@
11
# Emacs Text Editor
22

3-
## Basic Usage
4-
```TAB```
5-
```C-w```
6-
```M-w```
7-
```C-y```
8-
```C-SPACE```
9-
```C-s```
10-
```M-%```
11-
```C-x C-s```
12-
```C-x C-w```
13-
```C-x C-f```
14-
```C-x u```
15-
```C-x h```
16-
```C-x d```
17-
```C-g```
18-
```C-x C-+```
19-
```C-x C--```
20-
21-
## Buffers
22-
```C-x 2```
23-
```C-u 5 C-x 2```
24-
```C-x 3```
25-
```C-u 24 C-x 3```
26-
```C-x 1```
27-
```C-x 0```
28-
```C-x o```
29-
```C-x k```
30-
```C-x b```
31-
```C-x C-e```
3+
## Getting Started
4+
Emacs keybindings use a shorthand notation: **C-** means hold Ctrl, and **M-** means hold Alt (Meta). For example, **C-x C-s** means press Ctrl+x, then Ctrl+s.
5+
```[emacs](/man/emacs) textfile.txt```
6+
7+
| Key | Description |
8+
|-----|-------------|
9+
| **C-x C-f** | Open a file |
10+
| **C-x C-s** | Save current file |
11+
| **C-x C-w** | Save as (write to a different file) |
12+
| **C-x C-c** | Quit Emacs |
13+
| **C-g** | Cancel current command or operation |
14+
| **C-x u** | Undo last change |
3215

3316
## Navigation
34-
```C-b, C-f```
35-
```M-b, M-f```
36-
```C-p, C-n```
37-
```M-a, M-e```
38-
```M-{, M-}```
39-
```C-M-a, C-M-e```
40-
```C-a, C-e```
41-
42-
## Other Stuff
43-
```M-x eshell```
44-
```M-x goto-line```
45-
```M-x toggle-word-wrap```
46-
```M-x flyspell-mode```
47-
```M-x linum-mode```
48-
```M-x visual-line-mode```
49-
```M-x compile```
50-
```M-x package-list-packages```
17+
Movement commands come in pairs: **C-** moves by small units, **M-** moves by larger units.
18+
19+
| Key | Description |
20+
|-----|-------------|
21+
| **C-f** | Move forward one character |
22+
| **C-b** | Move backward one character |
23+
| **M-f** | Move forward one word |
24+
| **M-b** | Move backward one word |
25+
| **C-n** | Move to next line |
26+
| **C-p** | Move to previous line |
27+
| **C-a** | Move to beginning of line |
28+
| **C-e** | Move to end of line |
29+
| **M-a** | Move to beginning of sentence |
30+
| **M-e** | Move to end of sentence |
31+
| **M-{** | Move to beginning of paragraph |
32+
| **M-}** | Move to end of paragraph |
33+
| **C-M-a** | Move to beginning of function |
34+
| **C-M-e** | Move to end of function |
35+
36+
## Editing
37+
Mark a region with **C-SPACE** to set the start point, then move the cursor to select text.
38+
39+
| Key | Description |
40+
|-----|-------------|
41+
| **C-SPACE** | Set mark (start of selection) |
42+
| **C-x h** | Select the entire buffer |
43+
| **C-w** | Cut (kill) selected region |
44+
| **M-w** | Copy selected region |
45+
| **C-y** | Paste (yank) last killed text |
46+
| **C-k** | Kill from cursor to end of line |
47+
| **TAB** | Indent current line |
48+
| **C-x C-+** | Increase text size |
49+
| **C-x C--** | Decrease text size |
50+
51+
## Search and Replace
52+
Emacs uses incremental search — results appear as you type.
53+
54+
| Key | Description |
55+
|-----|-------------|
56+
| **C-s** | Search forward (incremental) |
57+
| **C-r** | Search backward (incremental) |
58+
| **M-%** | Search and replace (query mode) |
59+
60+
## Buffers and Windows
61+
Emacs can split the screen into multiple windows, each showing a buffer.
62+
63+
| Key | Description |
64+
|-----|-------------|
65+
| **C-x 2** | Split window horizontally |
66+
| **C-x 3** | Split window vertically |
67+
| **C-x 1** | Close all windows except current |
68+
| **C-x 0** | Close current window |
69+
| **C-x o** | Switch to the next window |
70+
| **C-x b** | Switch to a different buffer by name |
71+
| **C-x k** | Kill (close) a buffer |
72+
| **C-x d** | Open the directory browser (Dired) |
73+
74+
## Commands
75+
Run extended commands by name with **M-x** followed by the command name.
76+
77+
| Key | Description |
78+
|-----|-------------|
79+
| **M-x eshell** | Open a terminal shell inside Emacs |
80+
| **M-x goto-line** | Jump to a specific line number |
81+
| **M-x toggle-word-wrap** | Toggle word wrapping |
82+
| **M-x flyspell-mode** | Toggle spell checking |
83+
| **M-x linum-mode** | Toggle line numbers |
84+
| **M-x visual-line-mode** | Toggle visual line wrapping |
85+
| **M-x compile** | Run a compile command |
86+
| **M-x package-list-packages** | Browse and install packages |

assets/basics/microtexteditor.md

Lines changed: 103 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,105 @@
11
# Micro Text Editor
22

3-
## Default Keybindings
4-
```Up```
5-
```Down```
6-
```Right```
7-
```Left```
8-
```ShiftUp```
9-
```ShiftDown```
10-
```ShiftLeft```
11-
```ShiftRight```
12-
```AltLeft```
13-
```AltRight```
14-
```AltUp```
15-
```AltDown```
16-
```CtrlShiftRight```
17-
```CtrlShiftLeft```
18-
```AltShiftRight```
19-
```AltShiftLeft```
20-
```CtrlLeft```
21-
```CtrlRight```
22-
```ShiftHome```
23-
```ShiftEnd```
24-
```CtrlUp```
25-
```CtrlDown```
26-
```CtrlShiftUp```
27-
```CtrlShiftDown```
28-
```Alt-{```
29-
```Alt-}```
30-
```Enter```
31-
```Ctrl-h```
32-
```Backspace```
33-
```Alt-CtrlH```
34-
```Alt-Backspace```
35-
```Tab```
36-
```Backtab```
37-
```Ctrl-o```
38-
```Ctrl-s```
39-
```Ctrl-f```
40-
```Alt-F```
41-
```Ctrl-n```
42-
```Ctrl-p```
43-
```Ctrl-z```
44-
```Ctrl-y```
45-
```Ctrl-c```
46-
```Ctrl-x```
47-
```Ctrl-k```
48-
```Ctrl-d```
49-
```Ctrl-v```
50-
```Ctrl-a```
51-
```Ctrl-t```
52-
```Alt-,```
53-
```Alt-.```
54-
```Home```
55-
```End```
56-
```CtrlHome```
57-
```CtrlEnd```
58-
```PageUp```
59-
```PageDown```
60-
```CtrlPageUp```
61-
```CtrlPageDown```
62-
```Ctrl-g```
63-
```Alt-g```
64-
```Ctrl-r```
65-
```Ctrl-l```
66-
```Delete```
67-
```Ctrl-b```
68-
```Ctrl-q```
69-
```Ctrl-e```
70-
```Ctrl-w```
71-
```Ctrl-u```
72-
```Ctrl-j```
73-
```Insert```
74-
75-
## Emacs-style Keybindings
76-
```Alt-f```
77-
```Alt-b```
78-
```Alt-a```
79-
```Alt-e```
80-
81-
## File Manager Integration
82-
```F2```
83-
```F3```
84-
```F4```
85-
```F7```
86-
```F10```
87-
```Esc```
88-
89-
## Mouse Bindings
90-
```MouseWheelUp```
91-
```MouseWheelDown```
92-
```MouseLeft```
93-
```MouseMiddle```
94-
```Ctrl-MouseLeft```
95-
```Alt-n```
96-
```AltShiftUp```
97-
```AltShiftDown```
98-
```Alt-m```
99-
```Alt-p```
100-
```Alt-c```
101-
```Alt-x```
3+
## Getting Started
4+
Micro is a modern terminal text editor with intuitive keybindings. If you know **Ctrl+S** to save and **Ctrl+Z** to undo, you already know the basics.
5+
```[micro](/man/micro) textfile.txt```
6+
7+
| Key | Description |
8+
|-----|-------------|
9+
| **Ctrl+q** | Quit micro |
10+
| **Ctrl+s** | Save current file |
11+
| **Ctrl+o** | Open a file |
12+
| **Ctrl+g** | Open the help menu |
13+
| **Ctrl+e** | Open the command bar |
14+
15+
## Navigation
16+
Standard arrow keys, Home, End, Page Up, and Page Down all work as expected. These shortcuts provide additional movement.
17+
18+
| Key | Description |
19+
|-----|-------------|
20+
| **Ctrl+Left** | Move to previous word |
21+
| **Ctrl+Right** | Move to next word |
22+
| **Ctrl+Up** | Scroll up without moving cursor |
23+
| **Ctrl+Down** | Scroll down without moving cursor |
24+
| **Home** | Move to beginning of line |
25+
| **End** | Move to end of line |
26+
| **Ctrl+Home** | Move to start of file |
27+
| **Ctrl+End** | Move to end of file |
28+
29+
## Selection
30+
Hold **Shift** with any movement key to select text. These shortcuts select larger regions.
31+
32+
| Key | Description |
33+
|-----|-------------|
34+
| **Shift+Arrow** | Extend selection by one character or line |
35+
| **Ctrl+Shift+Left** | Select to previous word |
36+
| **Ctrl+Shift+Right** | Select to next word |
37+
| **Shift+Home** | Select to beginning of line |
38+
| **Shift+End** | Select to end of line |
39+
| **Ctrl+a** | Select all text |
40+
41+
## Editing
42+
Copy, cut, and paste use the familiar system shortcuts.
43+
44+
| Key | Description |
45+
|-----|-------------|
46+
| **Ctrl+z** | Undo |
47+
| **Ctrl+y** | Redo |
48+
| **Ctrl+c** | Copy selected text |
49+
| **Ctrl+x** | Cut selected text |
50+
| **Ctrl+v** | Paste from clipboard |
51+
| **Ctrl+k** | Cut the current line |
52+
| **Ctrl+d** | Duplicate the current line |
53+
| **Ctrl+u** | Upper/lowercase selection toggle |
54+
| **Tab** | Indent selection or insert tab |
55+
| **Backtab** | Unindent selection |
56+
57+
## Search and Replace
58+
Micro supports incremental search and regex-aware find and replace.
59+
60+
| Key | Description |
61+
|-----|-------------|
62+
| **Ctrl+f** | Find |
63+
| **Ctrl+n** | Find next match |
64+
| **Ctrl+p** | Find previous match |
65+
| **Ctrl+r** | Toggle find and replace |
66+
| **Alt+F** | Find literal (no regex) |
67+
68+
## Tabs and Splits
69+
Micro supports multiple open files in tabs and split views.
70+
71+
| Key | Description |
72+
|-----|-------------|
73+
| **Ctrl+t** | Open a new tab |
74+
| **Alt+,** | Switch to previous tab |
75+
| **Alt+.** | Switch to next tab |
76+
| **Ctrl+w** | Close current tab |
77+
| **Ctrl+b** | Run a shell command |
78+
| **Ctrl+j** | Jump to a matching bracket |
79+
| **Ctrl+l** | Toggle line numbers |
80+
| **Alt+g** | Toggle gutter |
81+
82+
## Mouse
83+
Micro has built-in mouse support. Click to place the cursor, scroll to navigate, and drag to select text.
84+
85+
| Key | Description |
86+
|-----|-------------|
87+
| **Mouse wheel** | Scroll up and down |
88+
| **Click** | Place cursor |
89+
| **Drag** | Select text |
90+
| **Ctrl+Click** | Place additional cursor (multi-cursor mode) |
91+
| **Alt+n** | Spawn a multi-cursor at next search match |
92+
| **Alt+m** | Spawn a multi-cursor on every search match |
93+
| **Alt+p** | Remove the last multi-cursor |
94+
| **Alt+c** | Remove all multi-cursors |
95+
| **Alt+x** | Skip current multi-cursor match |
96+
97+
## Emacs-style Navigation
98+
These alternative keybindings are available for Emacs users.
99+
100+
| Key | Description |
101+
|-----|-------------|
102+
| **Alt+f** | Move forward one word |
103+
| **Alt+b** | Move backward one word |
104+
| **Alt+a** | Move to beginning of line |
105+
| **Alt+e** | Move to end of line |

0 commit comments

Comments
 (0)