removing neotree to start open on file open

This commit is contained in:
Frodd
2025-08-28 20:55:30 +01:00
parent 604ead4e4e
commit 365ff4c1c0

View File

@@ -19,25 +19,6 @@ return {
config = function(_, opts)
require('neo-tree').setup(opts)
vim.keymap.set('n', '<C-n>', '<CMD>Neotree toggle<CR>', {})
-- Option 2: More targeted - only when opening actual files
vim.api.nvim_create_autocmd({"BufReadPost", "BufNewFile"}, {
callback = function()
-- Check if it's a real file (has a name and isn't a special buffer)
local bufname = vim.api.nvim_buf_get_name(0)
if bufname == "" or vim.bo.buftype ~= "" then
return
end
-- Skip if neo-tree is already visible
local manager = require("neo-tree.sources.manager")
local state = manager.get_state("filesystem")
if state.tree and state.tree.visible then
return
end
require("neo-tree.command").execute({ action = "show", source = "filesystem" })
end,
})
end,
}
}