My OS is Arch Linux, the edition of Lua is 5.4.4 I'm trying to configure the neovim pluging, nvim-tree. And my configuration Lua file are as follow.
local status, nvim_tree = pcall(require, "nvim-tree")
if not status then
vim.notify("can't find nvim-tree")
return
end
local list_keys = require('keybindings').nvimTreeList
nvim_tree.setup ({
auto_close = true,
git = {
enable = false
},
update_cwd = true,
update_focused_file = {
enable = true,
update_cwd = true
},
filters = {
dotfiles = true,
custom = {"node_modules"}
},
view = {
width = 30,
side = "left",
hide_root_folder = false,
auto_resize = true,
mappings = {
custom_only = false,
list = list_keys
},
number = false,
relativenumber = false,
signcolumn = "yes"
}
})
When opening neovim, there is an error message said that:
Error detected while processing ~/.config/nvim/init.lua:
E5113: Error while calling lua chunk:
~/.config/nvim/lua/plugin-config/nvim-tree.lua:10: attempt to call field 'setup' (a nil value)
stack traceback:
~/.config/nvim/lua/plugin-config/nvim-tree.lua:10: in main chunk
[C]: in function 'require'
~/.config/nvim/init.lua:10: in main chunk
But the nvim-tree can be used normally.
I had try to fixed it by changing the file into the way which described in the https://github.com/kyazdani42/nvim-tree.lua
require'nvim-tree'.setup { }
but it led to more error, because I used the
require("plugin-config.nvim-tree")
in the init.lua, the will have conflict.
So how can I fix this problem?