doc(#1676): clarify view.mapping.list contents including case of key
This commit is contained in:
@@ -1173,14 +1173,24 @@ exists.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
6. MAPPINGS *nvim-tree-mappings*
|
6. MAPPINGS *nvim-tree-mappings*
|
||||||
|
|
||||||
Setting your own mapping in the configuration will soon be deprecated, see |nvim-tree.on_attach| for experimental replacement.
|
Setting your own mapping in the configuration will soon be deprecated, see
|
||||||
|
|nvim-tree.on_attach| for experimental replacement.
|
||||||
|
|
||||||
The `list` option in `view.mappings.list` is a table of
|
`view.mappings.list` is a table of:
|
||||||
|
{key} (string|table of string) mandatory |{lhs}|.
|
||||||
|
|
||||||
- `key` (mandatory) string or a table of string
|
{action} (string) mandatory name of the action.
|
||||||
- `action` (mandatory) is the name of the action, set to `""` to remove default action, set to an arbitrary description when using `action_cb`
|
`""` to remove an action with {key}. The case of {key} must
|
||||||
- `action_cb` (optional) is a custom function that will be called, it receives the node as a parameter.
|
exactly match the action you are removing e.g. `'<Tab>'` to
|
||||||
- `mode` (optional) is `n` by default
|
remove the default preview action.
|
||||||
|
An arbitrary description when using `action_cb`.
|
||||||
|
|
||||||
|
{action_cb} (function) optional custom function that will be called.
|
||||||
|
Receives the node as a parameter.
|
||||||
|
Non-empty description for `action` is required.
|
||||||
|
|
||||||
|
{mode} (string) optional mode as per |nvim_set_keymap|.
|
||||||
|
Default `'n'`.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
>
|
>
|
||||||
@@ -1194,7 +1204,7 @@ Examples:
|
|||||||
mappings = {
|
mappings = {
|
||||||
list = {
|
list = {
|
||||||
-- remove a default mapping for cd
|
-- remove a default mapping for cd
|
||||||
{ key = "<2-RightMouse>", action = "" }, -- will remove default cd action
|
{ key = "<2-RightMouse>", action = "" },
|
||||||
|
|
||||||
-- add multiple normal mode mappings for edit
|
-- add multiple normal mode mappings for edit
|
||||||
{ key = { "<CR>", "o" }, action = "edit", mode = "n" },
|
{ key = { "<CR>", "o" }, action = "edit", mode = "n" },
|
||||||
|
|||||||
Reference in New Issue
Block a user