Closed jose-elias-alvarez closed 2 years ago
Didn't notice this because I set loaded_netrw
to 1 in my init.lua, preventing netrw from loading at all.
This plugin also spoofs the netrw loaded values when replace_netrw
is set in the setup function but it seems this is not always (on the latest nvim?) early enough to disable netrw.
The error should be avoided on the latest commit which clears the FileExplorer
autocmd before the schedule()
call, please confirm.
I would still suggest spoofing the netrw loaded variables to improve your startup time if you're gonna use replace_netrw
though. I.e. set in your init.lua:
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.loaded_netrwSettings = 1
vim.g.loaded_netrwFileHandlers = 1
Awesome, thanks for the quick fix!
Thanks for reporting and I'm glad you're enjoying the plugin!
Thanks for the great plugin! I'm a big fan of nnn and am surprised to see how well it works as a file tree.
I'm having a small issue with the
replace_netrw
setting that I wasn't able to figure out by going through the code. This is the minimal config required to replicate the issue:With this config, opening Neovim with
nvim .
immediately throws the following error:The explorer does open correctly, and opening subsequent directories (e.g. with
:e .
) once Neovim is open doesn't throw any errors.The strange part is that moving the config outside of
packer.startup
makes everything work properly:With this config,
nvim .
opens the explorer without any errors.It's also worth mentioning that I get this issue with the latest Neovim master (
NVIM v0.6.0-dev+622-gfd6df7481
) but not with 0.5.1, which works as expected with both configs. I have no idea what might have changed since 0.5.1 that affects this. It's not a dealbreaker for me, since I can achieve the same result withnvim -c NnnExplorer
and everything works once Neovim is actually open, but I figured it might be worth reporting in case there's an easy fix that I'm unaware of.