]> git.lizzy.rs Git - micro.git/blob - runtime/help/keybindings.md
Split help into multiple files and add help command
[micro.git] / runtime / help / keybindings.md
1 ### Keybindings
2
3 Here are the default keybindings in json form which is also how
4 you can rebind them to your liking.
5
6 ```json
7 {
8         "Up":             "CursorUp",
9         "Down":           "CursorDown",
10         "Right":          "CursorRight",
11         "Left":           "CursorLeft",
12         "ShiftUp":        "SelectUp",
13         "ShiftDown":      "SelectDown",
14         "ShiftLeft":      "SelectLeft",
15         "ShiftRight":     "SelectRight",
16         "AltLeft":        "WordLeft",
17         "AltRight":       "WordRight",
18         "AltShiftRight":  "SelectWordRight",
19         "AltShiftLeft":   "SelectWordLeft",
20         "CtrlLeft":       "StartOfLine",
21         "CtrlRight":      "EndOfLine",
22         "CtrlShiftLeft":  "SelectToStartOfLine",
23         "CtrlShiftRight": "SelectToEndOfLine",
24         "CtrlUp":         "CursorStart",
25         "CtrlDown":       "CursorEnd",
26         "CtrlShiftUp":    "SelectToStart",
27         "CtrlShiftDown":  "SelectToEnd",
28         "Enter":          "InsertEnter",
29         "Space":          "InsertSpace",
30         "Backspace":      "Backspace",
31         "Backspace2":     "Backspace",
32         "Alt-Backspace":  "DeleteWordLeft",
33         "Alt-Backspace2": "DeleteWordLeft",
34         "Tab":            "InsertTab",
35         "CtrlO":          "OpenFile",
36         "CtrlS":          "Save",
37         "CtrlF":          "Find",
38         "CtrlN":          "FindNext",
39         "CtrlP":          "FindPrevious",
40         "CtrlZ":          "Undo",
41         "CtrlY":          "Redo",
42         "CtrlC":          "Copy",
43         "CtrlX":          "Cut",
44         "CtrlK":          "CutLine",
45         "CtrlD":          "DuplicateLine",
46         "CtrlV":          "Paste",
47         "CtrlA":          "SelectAll",
48         "CtrlT":          "AddTab"
49         "CtrlRightSq":    "PreviousTab",
50         "CtrlBackslash":  "NextTab",
51         "Home":           "Start",
52         "End":            "End",
53         "PageUp":         "CursorPageUp",
54         "PageDown":       "CursorPageDown",
55         "CtrlG":          "ToggleHelp",
56         "CtrlR":          "ToggleRuler",
57         "CtrlL":          "JumpLine",
58         "Delete":         "Delete",
59         "Esc":            "ClearStatus",
60         "CtrlB":          "ShellMode",
61         "CtrlQ":          "Quit",
62         "CtrlE":          "CommandMode",
63         "CtrlW":          "NextSplit",
64         
65         // Emacs-style keybindings
66         "Alt-f": "WordRight",
67         "Alt-b": "WordLeft",
68         "Alt-a": "StartOfLine",
69         "Alt-e": "EndOfLine",
70         "Alt-p": "CursorUp",
71         "Alt-n": "CursorDown"
72 }
73 ```
74
75 You can use the alt keys + arrows to move word by word.
76 Ctrl left and right move the cursor to the start and end of the line, and
77 ctrl up and down move the cursor the start and end of the buffer.
78
79 You can hold shift with all of these movement actions to select while moving.
80
81 The bindings may be rebound using the `~/.config/micro/bindings.json`
82 file. Each key is bound to an action.
83
84 For example, to bind `Ctrl-y` to undo and `Ctrl-z` to redo, you could put the
85 following in the `bindings.json` file.
86
87 ```json
88 {
89         "CtrlY": "Undo",
90         "CtrlZ": "Redo"
91 }
92 ```