diff --git a/lua/oil/init.lua b/lua/oil/init.lua index bac18a3..0be3d27 100644 --- a/lua/oil/init.lua +++ b/lua/oil/init.lua @@ -952,7 +952,11 @@ M.setup = function(opts) end, }) end - if vim.g.loaded_netrwPlugin ~= 1 and not config.silence_netrw_warning then + if + vim.g.loaded_netrwPlugin ~= 1 + and not config.silence_netrw_warning + and config.default_file_explorer + then vim.api.nvim_create_autocmd("FileType", { desc = "Inform user how to disable netrw", group = aug, @@ -960,7 +964,7 @@ M.setup = function(opts) once = true, callback = function() vim.notify( - "If you expected an Oil buffer here, you may want to disable netrw (:help netrw-noload)\nSet `silence_netrw_warning = true` in oil.setup() to disable this message.", + "If you expected an Oil buffer here, you may want to disable netrw (:help netrw-noload)\nSet `default_file_explorer = false` in oil.setup() to not take over netrw buffers, or `silence_netrw_warning = true` to disable this message.", vim.log.levels.WARN ) end,