Skip to content

Collapse directories under current highlighted directory #3132

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
itsramiel opened this issue May 16, 2025 · 1 comment
Open

Collapse directories under current highlighted directory #3132

itsramiel opened this issue May 16, 2025 · 1 comment

Comments

@itsramiel
Copy link
Contributor

itsramiel commented May 16, 2025

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

@alex-courtis
Copy link
Member

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants