Open niderhoff opened 2 months ago
I use oil as well and I think the trick is to make sure it's lazy loaded until after the session is restored. What does your oil config look like?
For mine, i set keys
:
return {
'stevearc/oil.nvim',
keys = {
{
'<Bslash><Bslash>',
function() require('oil').toggle_float() end,
desc = 'Oil popup',
},
},
...
@cameronr
return {
"stevearc/oil.nvim",
opts = {},
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("oil").setup({
default_file_explorer = true,
delete_to_trash = true,
skip_confirm_for_simple_edits = false,
view_options = {
show_hidden = false,
natural_order = true,
is_always_hidden = function(name, _)
return name == '..' or name == '.git'
end,
},
win_options = {
wrap = true,
}
})
end,
}
its probably due to default_file_explorer
?
Shouldn't depend on default_file_explorer
(i have that in mine as well). What key do you use to open oil / how do you open it?
Or you can try my config:
return {
'stevearc/oil.nvim',
keys = {
{
'<Bslash><Bslash>',
function() require('oil').toggle_float() end,
desc = 'Oil',
},
},
opts = {
default_file_explorer = true,
delete_to_trash = true,
skip_confirm_for_simple_edits = false,
view_options = {
show_hidden = true,
natural_order = true,
is_always_hidden = function(name, _) return name == '..' or name == '.git' end,
},
float = {
padding = 2,
max_width = 90,
max_height = 0,
},
win_options = {
wrap = true,
winblend = 0,
},
keymaps = {
['<C-c>'] = false,
['q'] = 'actions.close',
['<Esc>'] = 'actions.close',
},
},
}
With the keys
block, oil isn't loaded until I press \\
so it doesn't interfere when launching nvim
with a directory argument.
@niderhoff are you still running into problems or did this resolve it for you?
Describe the bug Trying to restore a session from a path argument like this:
will fail, because it is compatible, with
oil.nvim
, because the latter is rewriting the argument from/my_folder/
tooil:///my_folder
.To Reproduce Steps to reproduce the behavior:
/my_folder
oil.nvim
nvim /my_folder/
oil
file explorer is startedExpected behavior Session is restored.
Screenshots Before
oil.nvim
:after:
Checkhealth
Baseline (please complete the following information):
Additional context