Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Toggle floating tree #2289

Closed
joelpeapen opened this issue Jun 22, 2023 · 1 comment
Closed

Toggle floating tree #2289

joelpeapen opened this issue Jun 22, 2023 · 1 comment
Labels
feature request PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated QOL Quality Of Life Improvement

Comments

@joelpeapen
Copy link

Can this functionality be implemented utilising API?
nvim-tree.api.tree.toggle() doesn't have an option for floating windows.

Sometimes it's useful to open the tree without interfering with the buffers, especially when using zen mode. I've done something simlilar to open floating terminals in zen mode, I'd like to do the same with nvim-tree.

local function vertical()
    if ZEN then
        vim.cmd(("ToggleTerm dir=p direction=float")
    else
        vim.cmd(("ToggleTerm size=70 dir=p direction=vertical")
    end
end
@alex-courtis
Copy link
Member

Unfortunately floating is an all-or-nothing option: view.float.enable and doesn't change during the session.

It could be done: tree.open, tree.toggle and tree.find_file could have an option added.

I'm not sure how this would behave until we try it out... Some exploration by changing the value of view.float.enable at runtime would be useful before adding the API options.

@alex-courtis alex-courtis added PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated QOL Quality Of Life Improvement labels Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request PR please nvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated QOL Quality Of Life Improvement
Projects
None yet
Development

No branches or pull requests

2 participants