nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua

Repository from Github https://github.comnvim-tree/nvim-tree.luaRepository from Github https://github.comnvim-tree/nvim-tree.lua

How could I assign options for toggle command?

CoinCheung opened this issue · comments

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?