X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Fhelp%2Fkeybindings.md;h=661c02fa85a55b8413843264739fc4bdfcc1a07d;hb=0f4f60c018a396e42f00f45b1279fcb06fa046e1;hp=463632ab3603d4ec5558b1b9a0c0d11726542ad8;hpb=678819683aba24fc8633e091fc271b5ff379ce0e;p=micro.git diff --git a/runtime/help/keybindings.md b/runtime/help/keybindings.md index 463632ab..661c02fa 100644 --- a/runtime/help/keybindings.md +++ b/runtime/help/keybindings.md @@ -8,7 +8,8 @@ command or you can also be added in the file `~/.config/micro/bindings.json` as discussed below. For a list of the default keybindings in the json format used by micro, please see the end of this file. For a more user-friendly list with explanations of what the default hotkeys are and what they do, please see -`>help defaultkeys` +`> help defaultkeys` (a json formatted list of default keys is included +at the end of this document). If `~/.config/micro/bindings.json` does not exist, you can simply create it. Micro will know what to do with it. @@ -47,6 +48,33 @@ save and quit you can bind it like so: } ``` +## Binding commands + +You can also bind a key to execute a command in command mode (see +`help commands`). Simply prepend the binding with `command:`. For example: + +```json +{ + "Alt-p": "command:pwd" +} +``` + +Now when you press `Alt-p` the `pwd` command will be executed which will show +your working directory in the infobar. + +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`: + +```json +{ + "CtrlG": "command-edit:help " +} +``` + +Now when you press `CtrlG`, `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). ## Binding raw escape sequences @@ -129,6 +157,7 @@ MoveLinesUp MoveLinesDown DeleteWordRight DeleteWordLeft +SelectLine SelectToStartOfLine SelectToEndOfLine InsertNewline @@ -159,6 +188,8 @@ Start End PageUp PageDown +SelectPageUp +SelectPageDown HalfPageUp HalfPageDown StartOfLine @@ -183,14 +214,16 @@ HSplit PreviousSplit ToggleMacro PlayMacro -Suspend (Linux only) +Suspend (Unix only) ScrollUp ScrollDown SpawnMultiCursor +SpawnMultiCursorSelect RemoveMultiCursor RemoveAllMultiCursors SkipMultiCursor UnbindKey +JumpToMatchingBrace ``` You can also bind some mouse actions (these must be bound to mouse buttons) @@ -322,6 +355,7 @@ CtrlRightSq CtrlCarat CtrlUnderscore Backspace +OldBackspace Tab Esc Escape @@ -435,6 +469,7 @@ MouseWheelRight // Multiple cursors bindings "Alt-n": "SpawnMultiCursor", + "Alt-m": "SpawnMultiCursorSelect", "Alt-p": "RemoveMultiCursor", "Alt-c": "RemoveAllMultiCursors", "Alt-x": "SkipMultiCursor",