]> git.lizzy.rs Git - micro.git/blobdiff - runtime/help/help.md
Add support for user-created commands
[micro.git] / runtime / help / help.md
index 3458f3ed39db240e4102978af5153c512a7269c4..4af7bee0239cc1c32e404f01d103c616c557deb2 100644 (file)
@@ -21,15 +21,10 @@ You can move the cursor around with the arrow keys and mouse.
 These are the default keybindings, along with their actions.
 
 
-#### Editor bindings
-
 * Ctrl-q:   Quit
 * Ctrl-e:   Execute a command
 * Ctrl-g:   Toggle help text
 * Ctrl-b:   Run a shell command
-
-#### Buffer bindings
-
 * Ctrl-s:   Save
 * Ctrl-o:   Open file
 * Ctrl-z:   Undo
@@ -55,7 +50,7 @@ ctrl up and down move the cursor the start and end of the buffer.
 
 You can hold shift with all of these movement actions to select while moving.
 
-The buffer bindings may be rebound using the `~/.config/micro/bindings.json` 
+The bindings may be rebound using the `~/.config/micro/bindings.json` 
 file. Each key is bound to an action.
 
 For example, to bind `Ctrl-y` to undo and `Ctrl-z` to redo, you could put the 
@@ -72,52 +67,64 @@ Here are the defaults:
 
 ```json
 {
-       "Up":             "CursorUp",
-       "Down":           "CursorDown",
-       "Right":          "CursorRight",
-       "Left":           "CursorLeft",
-       "ShiftUp":        "SelectUp",
-       "ShiftDown":      "SelectDown",
-       "ShiftLeft":      "SelectLeft",
-       "ShiftRight":     "SelectRight",
-       "AltLeft":        "WordLeft",
-       "AltRight":       "WordRight",
-       "AltShiftRight":  "SelectWordRight",
-       "AltShiftLeft":   "SelectWordLeft",
-       "CtrlLeft":       "StartOfLine",
-       "CtrlRight":      "EndOfLine",
-       "CtrlShiftLeft":  "SelectToStartOfLine",
-       "CtrlShiftRight": "SelectToEndOfLine",
-       "CtrlUp":         "CursorStart",
-       "CtrlDown":       "CursorEnd",
-       "CtrlShiftUp":    "SelectToStart",
-       "CtrlShiftDown":  "SelectToEnd",
-       "Enter":          "InsertEnter",
-       "Space":          "InsertSpace",
-       "Backspace":      "Backspace",
-       "Backspace2":     "Backspace",
-       "Tab":            "InsertTab",
-       "CtrlO":          "OpenFile",
-       "CtrlS":          "Save",
-       "CtrlF":          "Find",
-       "CtrlN":          "FindNext",
-       "CtrlP":          "FindPrevious",
-       "CtrlZ":          "Undo",
-       "CtrlY":          "Redo",
-       "CtrlC":          "Copy",
-       "CtrlX":          "Cut",
-       "CtrlK":          "CutLine",
-       "CtrlD":          "DuplicateLine",
-       "CtrlV":          "Paste",
-       "CtrlA":          "SelectAll",
-       "Home":           "Start",
-       "End":            "End",
-       "PgUp":           "PageUp",
-       "PgDn":           "PageDown",
-       "CtrlU":          "HalfPageUp",
-       "CtrlD":          "HalfPageDown",
-       "CtrlR":          "ToggleRuler",
-       "Delete":         "Delete"
+    "Up":             "CursorUp",
+    "Down":           "CursorDown",
+    "Right":          "CursorRight",
+    "Left":           "CursorLeft",
+    "ShiftUp":        "SelectUp",
+    "ShiftDown":      "SelectDown",
+    "ShiftLeft":      "SelectLeft",
+    "ShiftRight":     "SelectRight",
+    "AltLeft":        "WordLeft",
+    "AltRight":       "WordRight",
+    "AltShiftRight":  "SelectWordRight",
+    "AltShiftLeft":   "SelectWordLeft",
+    "CtrlLeft":       "StartOfLine",
+    "CtrlRight":      "EndOfLine",
+    "CtrlShiftLeft":  "SelectToStartOfLine",
+    "CtrlShiftRight": "SelectToEndOfLine",
+    "CtrlUp":         "CursorStart",
+    "CtrlDown":       "CursorEnd",
+    "CtrlShiftUp":    "SelectToStart",
+    "CtrlShiftDown":  "SelectToEnd",
+    "Enter":          "InsertEnter",
+    "Space":          "InsertSpace",
+    "Backspace":      "Backspace",
+    "Backspace2":     "Backspace",
+    "Tab":            "InsertTab",
+    "CtrlO":          "OpenFile",
+    "CtrlS":          "Save",
+    "CtrlF":          "Find",
+    "CtrlN":          "FindNext",
+    "CtrlP":          "FindPrevious",
+    "CtrlZ":          "Undo",
+    "CtrlY":          "Redo",
+    "CtrlC":          "Copy",
+    "CtrlX":          "Cut",
+    "CtrlK":          "CutLine",
+    "CtrlD":          "DuplicateLine",
+    "CtrlV":          "Paste",
+    "CtrlA":          "SelectAll",
+    "Home":           "Start",
+    "End":            "End",
+    "PgUp":           "PageUp",
+    "PgDn":           "PageDown",
+    "CtrlG":          "ToggleHelp",
+    "CtrlR":          "ToggleRuler",
+    "CtrlL":          "JumpLine",
+    "Delete":         "Delete",
+    "Esc":            "ClearStatus",
+    "CtrlB":          "ShellMode",
+    "CtrlQ":          "Quit",
+    "CtrlE":          "CommandMode",
+
+    // Emacs-style keybindings
+    "Alt-f": "WordRight",
+    "Alt-b": "WordLeft",
+    "Alt-a": "StartOfLine",
+    "Alt-e": "EndOfLine",
+    "Alt-p": "CursorUp",
+    "Alt-n": "CursorDown",
 }
 
 ```
@@ -145,6 +152,9 @@ Here are the possible commands that you can use.
 * `run sh-command`: runs the given shell command in the background. The 
    command's output will be displayed in one line when it finishes running.
 
+* `bind key action`: creates a keybinding from key to action. See the sections on
+   keybindings above for more info about what keys and actions are available.
+
 ### Options
 
 Micro stores all of the user configuration in its configuration directory.
@@ -207,11 +217,21 @@ Here are the options that you can set:
 
        default value: `on`
 
+* `savecursor`: remember where the cursor was last time the file was opened and
+   put it there when you open the file again
+
+    default value: `off`
+
+* `saveundo`: when this option is on, undo is saved even after you close a file
+   so if you close and reopen a file, you can keep undoing
+
+    default value: `off`
+
 * `scrollmargin`: amount of lines you would like to see above and below the cursor
 
        default value: `3`
 
-* `scrollspeed`: amount of lines to scroll
+* `scrollspeed`: amount of lines to scroll for one scroll event
 
        default value: `2`