feat: Add a new keybinding "W" to collapse the whole tree (#1013)
This commit is contained in:
committed by
GitHub
parent
95df001185
commit
9f3dc98de7
@@ -222,6 +222,7 @@ require'nvim-tree'.setup {
|
|||||||
- `R` will refresh the tree
|
- `R` will refresh the tree
|
||||||
- Double left click acts like `<CR>`
|
- Double left click acts like `<CR>`
|
||||||
- Double right click acts like `<C-]>`
|
- Double right click acts like `<C-]>`
|
||||||
|
- `W` will collapse the whole tree
|
||||||
|
|
||||||
### Settings
|
### Settings
|
||||||
|
|
||||||
@@ -284,6 +285,7 @@ local list = {
|
|||||||
{ key = "s", action = "system_open" },
|
{ key = "s", action = "system_open" },
|
||||||
{ key = "q", action = "close" },
|
{ key = "q", action = "close" },
|
||||||
{ key = "g?", action = "toggle_help" },
|
{ key = "g?", action = "toggle_help" },
|
||||||
|
{ key = "W", action = "collapse_all" }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -599,6 +599,8 @@ INFORMATIONS *nvim-tree-info*
|
|||||||
- Double left click acts like '<CR>'
|
- Double left click acts like '<CR>'
|
||||||
- Double right click acts like '<C-]>'
|
- Double right click acts like '<C-]>'
|
||||||
|
|
||||||
|
- 'W' will collapse the whole tree
|
||||||
|
|
||||||
Defaults to:
|
Defaults to:
|
||||||
>
|
>
|
||||||
lua <<EOF
|
lua <<EOF
|
||||||
@@ -636,6 +638,7 @@ Defaults to:
|
|||||||
{ key = "s", action = "system_open" },
|
{ key = "s", action = "system_open" },
|
||||||
{ key = "q", action = "close" },
|
{ key = "q", action = "close" },
|
||||||
{ key = "g?", action = "toggle_help" },
|
{ key = "g?", action = "toggle_help" },
|
||||||
|
{ key = 'W', action = "collapse_all" }
|
||||||
}
|
}
|
||||||
<
|
<
|
||||||
The `list` option in `view.mappings.list` is a table of
|
The `list` option in `view.mappings.list` is a table of
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ local M = {
|
|||||||
{ key = "-", action = "dir_up" },
|
{ key = "-", action = "dir_up" },
|
||||||
{ key = "s", action = "system_open" },
|
{ key = "s", action = "system_open" },
|
||||||
{ key = "q", action = "close"},
|
{ key = "q", action = "close"},
|
||||||
{ key = "g?", action = "toggle_help" }
|
{ key = "g?", action = "toggle_help" },
|
||||||
|
{ key = 'W', action = "collapse_all" }
|
||||||
},
|
},
|
||||||
custom_keypress_funcs = {},
|
custom_keypress_funcs = {},
|
||||||
}
|
}
|
||||||
@@ -47,6 +48,7 @@ local M = {
|
|||||||
local keypress_funcs = {
|
local keypress_funcs = {
|
||||||
close = view.close,
|
close = view.close,
|
||||||
close_node = require'nvim-tree.actions.movements'.parent_node(true),
|
close_node = require'nvim-tree.actions.movements'.parent_node(true),
|
||||||
|
collapse_all = require'nvim-tree.actions.collapse-all'.fn,
|
||||||
copy_absolute_path = require'nvim-tree.actions.copy-paste'.copy_absolute_path,
|
copy_absolute_path = require'nvim-tree.actions.copy-paste'.copy_absolute_path,
|
||||||
copy_name = require'nvim-tree.actions.copy-paste'.copy_filename,
|
copy_name = require'nvim-tree.actions.copy-paste'.copy_filename,
|
||||||
copy_path = require'nvim-tree.actions.copy-paste'.copy_path,
|
copy_path = require'nvim-tree.actions.copy-paste'.copy_path,
|
||||||
|
|||||||
Reference in New Issue
Block a user