Closed pablopunk closed 1 year ago
Silly me, I've just found Open at startup and saw the new changes. I fixed it by adding this to my config
local function open_nvim_tree()
require("nvim-tree.api").tree.open()
end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
EDIT: Although my desired behavior looks more like:
local function open_nvim_tree(data)
local is_real_file = vim.fn.filereadable(data.file) == 1
local is_no_name_file = data.file == "" and vim.bo[data.buf].buftype == ""
local is_a_directory = vim.fn.isdirectory(data.file) == 1
if is_a_directory then
vim.cmd.cd(data.file)
require("nvim-tree.api").tree.open()
return
end
if is_real_file or is_no_name_file then
require("nvim-tree.api").tree.toggle { focus = false, find_file = true }
return
end
end
Description
Sorry if this was asked before (couldn't find it).
Basically when opening a folder with
nvim folder
it used to show the nvim-tree view with all the contents of the directory. Now it doesn't do it anymore until I force it to reload the buffer (e.ge!
).I can reproduce it with the minimal config just adding
vim.g.loaded_netrwPlugin = 1
(see below)Neovim version
Operating system and version
macOS 13.1
nvim-tree version
02fdc26
Minimal config
Steps to reproduce
With the
nvt-min.lua
file loaded, I only needed to addvim.g.loaded_netrwPlugin = 1
to that config to reproduce the issue:Expected behavior
Show nvim-tree with directory contents
Actual behavior
It doesn't show nvim-tree