Skip to content

Add keymap for closing buffer of file under cursor #3037

@GCrispino

Description

@GCrispino

Is this a question?
No

Can this functionality be implemented utilising API?
If I understood correctly, no.

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
I believe it might be useful to add a keymap to close the buffer associated with the tree cursor, if such buffer exists.

If this cannot be done, might be useful to have this implemented in the API so a custom keymap can be added.

Describe alternatives you've considered
As mentioned, adding a custom keymap using an API method that can achieve this, if possible.

Additional context
I've done a draft implementation of this in a PR in my own fork of nvim-tree: GCrispino#1

It adds an API method at Api.node.close.close_file_buffer and a keymap to <C-c> that calls this method.

If the maintainers believe this is worth adding, I'd be happy to create a PR here for this

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions