mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
More command binding
Now can bind editable commands with `command-edit:` Ref #974
This commit is contained in:
@@ -47,6 +47,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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user