Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: default_file_explorer = true should not disable netrw #516

Closed
1 task done
rieje opened this issue Nov 13, 2024 · 3 comments
Closed
1 task done
Labels
enhancement New feature or request

Comments

@rieje
Copy link

rieje commented Nov 13, 2024

Did you check existing requests?

  • I have searched the existing issues

Describe the feature

It took me a while to realize oil.nvim's default_file_explorer = true disables netrw. From reading the description, this option should only prevent oil.nvim from being the defailt.

Provide background

I would like to use oil.nvim as the default but still keep netrw to use exclusively for tree. Currently this doesn't seem possible, i.e. you can only choose one or the other.

Ideally oil.nvim supports a simplistic tree-style view (no additional fancy features needed), most people enjoy tree-style view for providing additional context and visualization that vim-vinegar-like explorers can't offer.

What is the significance of this feature?

strongly desired

Additional details

No response

@rieje rieje added the enhancement New feature or request label Nov 13, 2024
@stevearc
Copy link
Owner

oil only disables netrw when default_file_explorer = true.

oil.nvim/lua/oil/init.lua

Lines 1074 to 1081 in 0472d92

if config.default_file_explorer then
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- If netrw was already loaded, clear this augroup
if vim.fn.exists("#FileExplorer") then
vim.api.nvim_create_augroup("FileExplorer", { clear = true })
end
end

If you are seeing that oil is disabling netrw even when default_file_explorer = false, then please submit a bug report with a minimal init.lua that reproduces the issue.

@stevearc stevearc added the question Further information is requested label Nov 14, 2024
@rieje rieje changed the title feature request: default_file_explorer = false should not disable netrw feature request: default_file_explorer = true should not disable netrw Nov 14, 2024
@rieje
Copy link
Author

rieje commented Nov 14, 2024

Sorry, I meant default_file_explorer = true (updated title/post to correct this).

Basically, the request is that oil.nvim can remain the default file explorer without disabling netrw, since netrw still provides features oil.nvim doesn't, most importantly a simplistic tree-style view. I want to use oil.nvim for everything and by default but still have netrw available for tree-view on a side bar, but setting oil.nvim as the default disables netrw.

@github-actions github-actions bot removed the question Further information is requested label Nov 14, 2024
@stevearc
Copy link
Owner

If you want oil to be the default file explorer (oil opens when you vim . or :edit .), you have to disable netrw. Before I enforced this people had all kinds of weird state issues due to collisions with netrw. If you want to still use netrw, you'll just have to open oil with keymaps or the :Oil command. Honestly, I would recommend using something else. It's been a staple for a long time and respect for that, but there are better options now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants