nvim-tree/nvim-tree.lua

Collapse directories under current highlighted directory

itsramiel opened this issue · 1 comments

Can this functionality be implemented utilising API?
The api does not cover it as mentioned here

Is your feature request related to a problem? Please describe.
Sometimes I want to unclutter my workspace by closing all open directories and focus on the current one

Describe the solution you'd like
A mapping that would do the above

Describe alternatives you've considered
None

Additional context
This discussion

Changing the signature for consistency:

tree.collapse_all({node}, {opts})          *nvim-tree-api.tree.collapse_all()*
    Collapse the tree.

    Parameters: ~
      • {node} (Node|nil) collapse only children of this directory
      • {opts} (table) optional parameters

    Options: ~
      • {keep_buffers} (boolean?) do not collapse nodes with open buffers, default false