fix(nvim): lazy load neo-tree for real this time 🙏
This commit is contained in:
parent
f4e81c6a92
commit
e87dbfbd72
@ -1,3 +1,5 @@
|
|||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
@ -15,11 +17,10 @@ return {
|
|||||||
-- Correctly hijack netrw, thanks to
|
-- Correctly hijack netrw, thanks to
|
||||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim/issues/1247#issuecomment-1836294271
|
-- https://github.com/nvim-neo-tree/neo-tree.nvim/issues/1247#issuecomment-1836294271
|
||||||
vim.api.nvim_create_autocmd("BufEnter", {
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
once = true,
|
desc = "Lazy loads neo-tree when opening a directory",
|
||||||
callback = function()
|
callback = function(args)
|
||||||
local f = vim.fn.expand("%:p")
|
local stats = vim.uv.fs_stat(args.file)
|
||||||
local isdir = vim.fn.isdirectory(f)
|
if stats and stats.type == "directory" then
|
||||||
if isdir == 1 or f == "" then
|
|
||||||
require("neo-tree")
|
require("neo-tree")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -48,7 +49,7 @@ return {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
source = "remote",
|
source = "remote",
|
||||||
display_name = " Remote"
|
display_name = " Remote",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user