I am trying to use neo-tree for my file manager plugin, installing with Lazy. However, when I try and open neovim to a directory using “nvim .”, it hijacks netrw. which is right, but appears on the left, which I don’t want because that breaks my flow. I have C-e mapped to opening neo-tree on the right, and pressing C-e C-e to close it then open another respects my settings and opens it on the right. Nothing short of an incredibly slow autocmd to close that automatically opened neotree buffer and open a new one to respect my settings has worked. Attached is the relevant parts of my config for reference:
return function()
require(“neo-tree”).setup({
close_floats_on_escape_key = true,
bind_to_cwd = false,
follow_current_file = true,
close_if_last_window = false,
source_selector = {
winbar = true,
statusline = false
},
filesystem = {
window = {
position = "float",
float = {
width = "100%",
height = "100%"
},
mappings = {
['n'] = "add"
}
},
},
default_component_configs = {
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "",
default = ""
}
},
event_handlers = {
event = 'file_opened',
handler = function(arg)
require 'neo-tree'.close()
end,
id = 'auto-close-neo-tree'
},
})
end
Has anyone else experienced this? Am I just missing something?
Also as a side thing, I’d like them also to close when I select a file to open with enter, so that I don’t have to waste a C-e keystroke to remove them, does anyone know how to help?