Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How could I assign options for toggle command? #3079

Closed
CoinCheung opened this issue Mar 9, 2025 · 0 comments
Closed

How could I assign options for toggle command? #3079

CoinCheung opened this issue Mar 9, 2025 · 0 comments

Comments

@CoinCheung
Copy link

CoinCheung commented Mar 9, 2025

I tried this but it failed.

vim.keymap.set("n", "<leader>n", ":NvimTreeToggle<cr>", {current_window=true})

When I try this, it works:

vim.keymap.set("n", "<leader>n",
    function() nvim_tree_api.tree.toggle({ path = "<args>", current_window = false, focus = true, find_file = false, update_root = false }) end,
    { noremap = true })

But when I run this in split window, it will destroy my split pattern, and open the file in non-focus buffer. Maybe this is a bug, or is there other points to config?

@nvim-tree nvim-tree locked and limited conversation to collaborators Mar 9, 2025
@gegoune gegoune converted this issue into discussion #3080 Mar 9, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

1 participant