Improve keybinding label consistency

The old notation (for example `CtrlG`) causes confusion when combined
with new notation needed for alt (`Alt-g`) due to Alt being case
sensitive. Previously both formats were supported, but the documentation
and defaults used a combination. This commit only uses the new notation
for consistency.

Ref #1470
This commit is contained in:
Zachary Yedidia
2020-06-17 23:11:50 -04:00
parent 2adba18159
commit f5405cee18
7 changed files with 132 additions and 126 deletions

View File

@@ -16,8 +16,8 @@ the settings and their values. To change an option, you can either change the
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.
@@ -48,12 +48,12 @@ If you would like to know more about all the available options, see the
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"
}
```
@@ -74,7 +74,7 @@ micro starts and is essentially a one-file plugin. The plugin name is
`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`:
@@ -84,9 +84,9 @@ local config = import("micro/config")
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)
@@ -104,7 +104,7 @@ the `bindings.json` file:
```json
{
"CtrlR": "lua:initlua.gorun"
"Ctrl-r": "lua:initlua.gorun"
}
```