"Alt-{": "ParagraphPrevious",
"Alt-}": "ParagraphNext",
"Enter": "InsertNewline",
- "CtrlH": "Backspace",
+ "Ctrl-h": "Backspace",
"Backspace": "Backspace",
"Alt-CtrlH": "DeleteWordLeft",
"Alt-Backspace": "DeleteWordLeft",
"Tab": "Autocomplete|IndentSelection|InsertTab",
"Backtab": "CycleAutocompleteBack|OutdentSelection|OutdentLine",
- "CtrlO": "OpenFile",
- "CtrlS": "Save",
- "CtrlF": "Find",
- "CtrlN": "FindNext",
- "CtrlP": "FindPrevious",
- "CtrlZ": "Undo",
- "CtrlY": "Redo",
- "CtrlC": "CopyLine|Copy",
- "CtrlX": "Cut",
- "CtrlK": "CutLine",
- "CtrlD": "DuplicateLine",
- "CtrlV": "Paste",
- "CtrlA": "SelectAll",
- "CtrlT": "AddTab",
- "Alt,": "PreviousTab",
- "Alt.": "NextTab",
+ "Ctrl-o": "OpenFile",
+ "Ctrl-s": "Save",
+ "Ctrl-f": "Find",
+ "Ctrl-n": "FindNext",
+ "Ctrl-p": "FindPrevious",
+ "Ctrl-z": "Undo",
+ "Ctrl-y": "Redo",
+ "Ctrl-c": "CopyLine|Copy",
+ "Ctrl-x": "Cut",
+ "Ctrl-k": "CutLine",
+ "Ctrl-d": "DuplicateLine",
+ "Ctrl-v": "Paste",
+ "Ctrl-a": "SelectAll",
+ "Ctrl-t": "AddTab",
+ "Alt-,": "PreviousTab",
+ "Alt-.": "NextTab",
"Home": "StartOfTextToggle",
"End": "EndOfLine",
"CtrlHome": "CursorStart",
"PageDown": "CursorPageDown",
"CtrlPageUp": "PreviousTab",
"CtrlPageDown": "NextTab",
- "CtrlG": "ToggleHelp",
+ "Ctrl-g": "ToggleHelp",
"Alt-g": "ToggleKeyMenu",
- "CtrlR": "ToggleRuler",
- "CtrlL": "command-edit:goto ",
+ "Ctrl-r": "ToggleRuler",
+ "Ctrl-l": "command-edit:goto ",
"Delete": "Delete",
- "CtrlB": "ShellMode",
- "CtrlQ": "Quit",
- "CtrlE": "CommandMode",
- "CtrlW": "NextSplit",
- "CtrlU": "ToggleMacro",
- "CtrlJ": "PlayMacro",
+ "Ctrl-b": "ShellMode",
+ "Ctrl-q": "Quit",
+ "Ctrl-e": "CommandMode",
+ "Ctrl-w": "NextSplit",
+ "Ctrl-u": "ToggleMacro",
+ "Ctrl-j": "PlayMacro",
"Insert": "ToggleOverwriteMode",
// Emacs-style keybindings
"Alt-{": "ParagraphPrevious",
"Alt-}": "ParagraphNext",
"Enter": "InsertNewline",
- "CtrlH": "Backspace",
+ "Ctrl-h": "Backspace",
"Backspace": "Backspace",
"Alt-CtrlH": "DeleteWordLeft",
"Alt-Backspace": "DeleteWordLeft",
"Tab": "Autocomplete|IndentSelection|InsertTab",
"Backtab": "CycleAutocompleteBack|OutdentSelection|OutdentLine",
- "CtrlO": "OpenFile",
- "CtrlS": "Save",
- "CtrlF": "Find",
- "CtrlN": "FindNext",
- "CtrlP": "FindPrevious",
- "CtrlZ": "Undo",
- "CtrlY": "Redo",
- "CtrlC": "CopyLine|Copy",
- "CtrlX": "Cut",
- "CtrlK": "CutLine",
- "CtrlD": "DuplicateLine",
- "CtrlV": "Paste",
- "CtrlA": "SelectAll",
- "CtrlT": "AddTab",
- "Alt,": "PreviousTab",
- "Alt.": "NextTab",
+ "Ctrl-o": "OpenFile",
+ "Ctrl-s": "Save",
+ "Ctrl-f": "Find",
+ "Ctrl-n": "FindNext",
+ "Ctrl-p": "FindPrevious",
+ "Ctrl-z": "Undo",
+ "Ctrl-y": "Redo",
+ "Ctrl-c": "CopyLine|Copy",
+ "Ctrl-x": "Cut",
+ "Ctrl-k": "CutLine",
+ "Ctrl-d": "DuplicateLine",
+ "Ctrl-v": "Paste",
+ "Ctrl-a": "SelectAll",
+ "Ctrl-t": "AddTab",
+ "Alt-,": "PreviousTab",
+ "Alt-.": "NextTab",
"Home": "StartOfTextToggle",
"End": "EndOfLine",
"CtrlHome": "CursorStart",
"PageDown": "CursorPageDown",
"CtrlPageUp": "PreviousTab",
"CtrlPageDown": "NextTab",
- "CtrlG": "ToggleHelp",
+ "Ctrl-g": "ToggleHelp",
"Alt-g": "ToggleKeyMenu",
- "CtrlR": "ToggleRuler",
- "CtrlL": "command-edit:goto ",
+ "Ctrl-r": "ToggleRuler",
+ "Ctrl-l": "command-edit:goto ",
"Delete": "Delete",
- "CtrlB": "ShellMode",
- "CtrlQ": "Quit",
- "CtrlE": "CommandMode",
- "CtrlW": "NextSplit",
- "CtrlU": "ToggleMacro",
- "CtrlJ": "PlayMacro",
+ "Ctrl-b": "ShellMode",
+ "Ctrl-q": "Quit",
+ "Ctrl-e": "CommandMode",
+ "Ctrl-w": "NextSplit",
+ "Ctrl-u": "ToggleMacro",
+ "Ctrl-j": "PlayMacro",
"Insert": "ToggleOverwriteMode",
// Emacs-style keybindings
## Colorschemes
-To change your colorscheme, press CtrlE in micro to bring up the command
+To change your colorscheme, press Ctrl-e in micro to bring up the command
prompt, and type:
```
# Command bar
-The command bar is opened by pressing CtrlE. It is a single-line buffer,
+The command bar is opened by pressing Ctrl-e. It is a single-line buffer,
meaning that all keybindings from a normal buffer are supported (as well
as mouse and selection).
# Commands
Micro provides the following commands that can be executed at the command-bar
-by pressing `CtrlE` and entering the command. Arguments are placed in single
+by pressing `Ctrl-e` and entering the command. Arguments are placed in single
quotes here but these are not necessary when entering the command in micro.
* `bind 'key' 'action'`: creates a keybinding from key to action. See the
is most useful for debugging keybindings.
* `showkey`: Show the action(s) bound to a given key. For example
- running `> showkey CtrlC` will display `Copy`.
+ running `> showkey Ctrl-c` will display `Copy`.
* `term exec?`: Open a terminal emulator running the given executable. If no
executable is given, this will open the default shell in the terminal
intuitive, while also taking advantage of the full capabilities of modern
terminals.
-To open the command bar, press CtrlE. This enables a `>` prompt for typing
+To open the command bar, press Ctrl-e. This enables a `>` prompt for typing
commands. From now on when the documentation says to run a command such as `>
-help`, this means press CtrlE and type `help` (and press enter to execute the
+help`, this means press Ctrl-e and type `help` (and press enter to execute the
command).
For a list of the default keybindings run `> help defaultkeys`.
## Quick-start
-Press Ctrl-q to quit, and Ctrl-s to save. Press CtrlE to start typing commands
+Press Ctrl-q to quit, and Ctrl-s to save. Press Ctrl-e to start typing commands
and you can see which commands are available by pressing tab, or by viewing the
help topic `> help commands`.
Micro has a built-in help system which can be accessed with the `help` command.
-To use it, press CtrlE to access command mode and type in `help` followed by a
+To use it, press Ctrl-e to access command mode and type in `help` followed by a
topic. Typing `help` followed by nothing will open this page.
Here are the possible help topics that you can read:
```json
{
- "CtrlY": "Undo",
- "CtrlZ": "Redo"
+ "Ctrl-y": "Undo",
+ "Ctrl-z": "Redo"
}
```
+**Note:** The syntax `<Modifier><key>` is equivalent to `<Modifier>-<key>`. In
+addition, Ctrl-Shift bindings are not supported by terminals, and are the same
+as simply Ctrl bindings. This means that `CtrlG`, `Ctrl-G`, and `Ctrl-g` all
+mean the same thing. However, for Alt this is not the case: `AltG` and `Alt-G`
+mean `Alt-Shift-g`, while `Alt-g` does not require the Shift modifier.
+
In addition to editing your `~/.config/micro/bindings.json`, you can run
`>bind <keycombo> <action>` For a list of bindable actions, see below.
You can also bind an "editable" command with `command-edit:`. This means that
micro won't immediately execute the command when you press the binding, but
instead just place the string in the infobar in command mode. For example,
-you could rebind `CtrlG` to `> help`:
+you could rebind `Ctrl-g` to `> help`:
```json
{
- "CtrlG": "command-edit:help "
+ "Ctrl-g": "command-edit:help "
}
```
-Now when you press `CtrlG`, `help` will appear in the command bar and your
+Now when you press `Ctrl-g`, `help` will appear in the command bar and your
cursor will be placed after it (note the space in the json that controls the
cursor placement).
F63
F64
CtrlSpace
-CtrlA
-CtrlB
-CtrlC
-CtrlD
-CtrlE
-CtrlF
-CtrlG
-CtrlH
-CtrlI
-CtrlJ
-CtrlK
-CtrlL
-CtrlM
-CtrlN
-CtrlO
-CtrlP
-CtrlQ
-CtrlR
-CtrlS
-CtrlT
-CtrlU
-CtrlV
-CtrlW
-CtrlX
-CtrlY
-CtrlZ
+Ctrl-a
+Ctrl-b
+Ctrl-c
+Ctrl-d
+Ctrl-e
+Ctrl-f
+Ctrl-g
+Ctrl-h
+Ctrl-i
+Ctrl-j
+Ctrl-k
+Ctrl-l
+Ctrl-m
+Ctrl-n
+Ctrl-o
+Ctrl-p
+Ctrl-q
+Ctrl-r
+Ctrl-s
+Ctrl-t
+Ctrl-u
+Ctrl-v
+Ctrl-w
+Ctrl-x
+Ctrl-y
+Ctrl-z
CtrlLeftSq
CtrlBackslash
CtrlRightSq
"Alt-{": "ParagraphPrevious",
"Alt-}": "ParagraphNext",
"Enter": "InsertNewline",
- "CtrlH": "Backspace",
+ "Ctrl-h": "Backspace",
"Backspace": "Backspace",
"Alt-CtrlH": "DeleteWordLeft",
"Alt-Backspace": "DeleteWordLeft",
"Tab": "Autocomplete|IndentSelection|InsertTab",
"Backtab": "OutdentSelection|OutdentLine",
- "CtrlO": "OpenFile",
- "CtrlS": "Save",
- "CtrlF": "Find",
- "CtrlN": "FindNext",
- "CtrlP": "FindPrevious",
- "CtrlZ": "Undo",
- "CtrlY": "Redo",
- "CtrlC": "CopyLine|Copy",
- "CtrlX": "Cut",
- "CtrlK": "CutLine",
- "CtrlD": "DuplicateLine",
- "CtrlV": "Paste",
- "CtrlA": "SelectAll",
- "CtrlT": "AddTab",
- "Alt,": "PreviousTab",
- "Alt.": "NextTab",
+ "Ctrl-o": "OpenFile",
+ "Ctrl-s": "Save",
+ "Ctrl-f": "Find",
+ "Ctrl-n": "FindNext",
+ "Ctrl-p": "FindPrevious",
+ "Ctrl-z": "Undo",
+ "Ctrl-y": "Redo",
+ "Ctrl-c": "CopyLine|Copy",
+ "Ctrl-x": "Cut",
+ "Ctrl-k": "CutLine",
+ "Ctrl-d": "DuplicateLine",
+ "Ctrl-v": "Paste",
+ "Ctrl-a": "SelectAll",
+ "Ctrl-t": "AddTab",
+ "Alt-,": "PreviousTab",
+ "Alt-.": "NextTab",
"Home": "StartOfText",
"End": "EndOfLine",
"CtrlHome": "CursorStart",
"PageDown": "CursorPageDown",
"CtrlPageUp": "PreviousTab",
"CtrlPageDown": "NextTab",
- "CtrlG": "ToggleHelp",
+ "Ctrl-g": "ToggleHelp",
"Alt-g": "ToggleKeyMenu",
- "CtrlR": "ToggleRuler",
- "CtrlL": "command-edit:goto ",
+ "Ctrl-r": "ToggleRuler",
+ "Ctrl-l": "command-edit:goto ",
"Delete": "Delete",
- "CtrlB": "ShellMode",
- "CtrlQ": "Quit",
- "CtrlE": "CommandMode",
- "CtrlW": "NextSplit",
- "CtrlU": "ToggleMacro",
- "CtrlJ": "PlayMacro",
+ "Ctrl-b": "ShellMode",
+ "Ctrl-q": "Quit",
+ "Ctrl-e": "CommandMode",
+ "Ctrl-w": "NextSplit",
+ "Ctrl-u": "ToggleMacro",
+ "Ctrl-j": "PlayMacro",
"Insert": "ToggleOverwriteMode",
// Emacs-style keybindings
## Final notes
-Note: On some old terminal emulators and on Windows machines, `CtrlH` should be
+Note: On some old terminal emulators and on Windows machines, `Ctrl-h` should be
used for backspace.
Additionally, alt keys can be bound by using `Alt-key`. For example `Alt-a` or
value in the `settings.json` file, or you can type it in directly while using
micro.
-Press CtrlE to go to command mode, and type `set option value` (in the
-future, I will use `> set option value` to indicate pressing CtrlE). The change
+Press Ctrl-e to go to command mode, and type `set option value` (in the
+future, I will use `> set option value` to indicate pressing Ctrl-e). The change
will take effect immediately and will also be saved to the `settings.json` file
so that the setting will stick even after you close micro.
Keybindings work in much the same way as options. You configure them using the
`~/.config/micro/bindings.json` file.
-For example if you would like to bind `CtrlR` to redo you could put the
+For example if you would like to bind `Ctrl-r` to redo you could put the
following in `bindings.json`:
```json
{
- "CtrlR": "redo"
+ "Ctrl-r": "redo"
}
```
`initlua`.
This example will show you how to use the `init.lua` file by creating a binding
-to `CtrlR` which will execute the bash command `go run` on the current file,
+to `Ctrl-r` which will execute the bash command `go run` on the current file,
given that the current file is a Go file.
You can do that by putting the following in `init.lua`:
local shell = import("micro/shell")
function init()
- -- true means overwrite any existing binding to CtrlR
+ -- true means overwrite any existing binding to Ctrl-r
-- this will modify the bindings.json file
- config.TryBindKey("CtrlR", "lua:initlua.gorun", true)
+ config.TryBindKey("Ctrl-r", "lua:initlua.gorun", true)
end
function gorun(bp)
```json
{
- "CtrlR": "lua:initlua.gorun"
+ "Ctrl-r": "lua:initlua.gorun"
}
```