Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Fix netrw and explorer features #380

Merged
merged 3 commits into from
Aug 8, 2022
Merged

Conversation

edwintorok
Copy link
Contributor

Muscle memory on :e . and :e ~/. Used to work on previous version of Doom, but only shows an error message . is a directory on 4.0.x.
This was handled by netrw which is now entirely disabled (to optimize startup time I assume).

First of all, when the netrw feature is used instead of explorer we shouldn't disable loading netrw :)
Next, when explorer is used an autocommand is needed to toggle loading it when editing directories. This wouldn't be needed if its setup() function was run, but the module is lazy-loaded to decrease startup time, so we need this autocmd.

See :h nvim-tree-api (after loading nvim-tree, e.g. by editing a dir) for a stable way to call nvim-tree functions.

Because netrw is turned off only an error message `<path> is a directory` is
seen when trying to `:e path`.
Add an autocommand that triggers loading nvim-tree and open the tree
at the specified directory.

Helps with muscle memory on `:e .`

Signed-off-by: Edwin Török <[email protected]>
Copy link
Collaborator

@NTBBloodbath NTBBloodbath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,
Thank you so much for this PR with fixes and sorry for the current version behavior!

Everything looks good to me, merging it right now.

Cheers

@NTBBloodbath NTBBloodbath merged commit bf67dad into doom-neovim:main Aug 8, 2022
@edwintorok edwintorok deleted the dir-fixes branch December 31, 2022 15:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants