Improve documentation for command modes
This commit is contained in:
parent
07079664a6
commit
f70c5968a9
@ -125,7 +125,8 @@ Bind a key to a command.
|
|||||||
|
|
||||||
|
|
||||||
==== optional arguments
|
==== optional arguments
|
||||||
* +*-m*+, +*--mode*+: A comma-separated list of modes to bind the key in (default: `normal`).
|
* +*-m*+, +*--mode*+: A comma-separated list of modes to bind the key in (default: `normal`). See `:help bindings.commands` for the
|
||||||
|
available modes.
|
||||||
|
|
||||||
* +*-f*+, +*--force*+: Rebind the key if it is already bound.
|
* +*-f*+, +*--force*+: Rebind the key if it is already bound.
|
||||||
|
|
||||||
@ -938,7 +939,8 @@ Unbind a keychain.
|
|||||||
|
|
||||||
==== positional arguments
|
==== positional arguments
|
||||||
* +'key'+: The keychain or special key (inside <...>) to unbind.
|
* +'key'+: The keychain or special key (inside <...>) to unbind.
|
||||||
* +'mode'+: A mode to unbind the key in (default: `normal`).
|
* +'mode'+: A mode to unbind the key in (default: `normal`). See `:help bindings.commands` for the available modes.
|
||||||
|
|
||||||
|
|
||||||
[[undo]]
|
[[undo]]
|
||||||
=== undo
|
=== undo
|
||||||
|
@ -308,7 +308,9 @@ For simple keys (no `<>`-signs), a capital letter means the key is pressed with
|
|||||||
If you want a binding to do nothing, bind it to the `nop` command. If you want a default binding to be passed through to the website, bind it to null.
|
If you want a binding to do nothing, bind it to the `nop` command. If you want a default binding to be passed through to the website, bind it to null.
|
||||||
Note that some commands which are only useful for bindings (but not used interactively) are hidden from the command completion. See `:help` for a full list of available commands.
|
Note that some commands which are only useful for bindings (but not used interactively) are hidden from the command completion. See `:help` for a full list of available commands.
|
||||||
The following modes are available:
|
The following modes are available:
|
||||||
|
|
||||||
* normal: The default mode, where most commands are invoked.
|
* normal: The default mode, where most commands are invoked.
|
||||||
|
|
||||||
* insert: Entered when an input field is focused on a website, or by
|
* insert: Entered when an input field is focused on a website, or by
|
||||||
pressing `i` in normal mode. Passes through almost all keypresses to the
|
pressing `i` in normal mode. Passes through almost all keypresses to the
|
||||||
website, but has some bindings like `<Ctrl-e>` to open an external editor.
|
website, but has some bindings like `<Ctrl-e>` to open an external editor.
|
||||||
@ -328,7 +330,7 @@ The following modes are available:
|
|||||||
|
|
||||||
* prompt: Entered when there's a prompt to display, like for download
|
* prompt: Entered when there's a prompt to display, like for download
|
||||||
locations or when invoked from JavaScript.
|
locations or when invoked from JavaScript.
|
||||||
|
+
|
||||||
You can bind normal keys in this mode, but they will be only active when a
|
You can bind normal keys in this mode, but they will be only active when a
|
||||||
yes/no-prompt is asked. For other prompt modes, you can only bind special
|
yes/no-prompt is asked. For other prompt modes, you can only bind special
|
||||||
keys.
|
keys.
|
||||||
|
@ -320,7 +320,8 @@ class ConfigCommands:
|
|||||||
command: The command to execute, with optional args, or None to
|
command: The command to execute, with optional args, or None to
|
||||||
print the current binding.
|
print the current binding.
|
||||||
mode: A comma-separated list of modes to bind the key in
|
mode: A comma-separated list of modes to bind the key in
|
||||||
(default: `normal`).
|
(default: `normal`). See `:help bindings.commands` for the
|
||||||
|
available modes.
|
||||||
force: Rebind the key if it is already bound.
|
force: Rebind the key if it is already bound.
|
||||||
"""
|
"""
|
||||||
if command is None:
|
if command is None:
|
||||||
@ -352,6 +353,7 @@ class ConfigCommands:
|
|||||||
Args:
|
Args:
|
||||||
key: The keychain or special key (inside <...>) to unbind.
|
key: The keychain or special key (inside <...>) to unbind.
|
||||||
mode: A mode to unbind the key in (default: `normal`).
|
mode: A mode to unbind the key in (default: `normal`).
|
||||||
|
See `:help bindings.commands` for the available modes.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
self._keyconfig.unbind(key, mode=mode, save_yaml=True)
|
self._keyconfig.unbind(key, mode=mode, save_yaml=True)
|
||||||
|
@ -2177,8 +2177,10 @@ bindings.commands:
|
|||||||
|
|
||||||
The following modes are available:
|
The following modes are available:
|
||||||
|
|
||||||
|
|
||||||
* normal: The default mode, where most commands are invoked.
|
* normal: The default mode, where most commands are invoked.
|
||||||
|
|
||||||
|
|
||||||
* insert: Entered when an input field is focused on a website, or by
|
* insert: Entered when an input field is focused on a website, or by
|
||||||
pressing `i` in normal mode. Passes through almost all keypresses to the
|
pressing `i` in normal mode. Passes through almost all keypresses to the
|
||||||
website, but has some bindings like `<Ctrl-e>` to open an external editor.
|
website, but has some bindings like `<Ctrl-e>` to open an external editor.
|
||||||
@ -2198,7 +2200,7 @@ bindings.commands:
|
|||||||
|
|
||||||
* prompt: Entered when there's a prompt to display, like for download
|
* prompt: Entered when there's a prompt to display, like for download
|
||||||
locations or when invoked from JavaScript.
|
locations or when invoked from JavaScript.
|
||||||
|
+
|
||||||
You can bind normal keys in this mode, but they will be only active when a
|
You can bind normal keys in this mode, but they will be only active when a
|
||||||
yes/no-prompt is asked. For other prompt modes, you can only bind special
|
yes/no-prompt is asked. For other prompt modes, you can only bind special
|
||||||
keys.
|
keys.
|
||||||
|
Loading…
Reference in New Issue
Block a user