feat: inform user how to disable netrw
This commit is contained in:
parent
a6884431b0
commit
6b10a36641
1 changed files with 14 additions and 0 deletions
|
|
@ -699,6 +699,20 @@ M.setup = function(opts)
|
|||
end,
|
||||
})
|
||||
end
|
||||
if vim.g.loaded_netrwPlugin ~= 1 and not config.silence_netrw_warning then
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
desc = "Inform user how to disable netrw",
|
||||
group = aug,
|
||||
pattern = "netrw",
|
||||
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.",
|
||||
vim.log.levels.WARN
|
||||
)
|
||||
end,
|
||||
})
|
||||
end
|
||||
vim.api.nvim_create_autocmd("WinNew", {
|
||||
desc = "Restore window options when splitting an oil window",
|
||||
group = aug,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue