stevearc / oil.nvim

Neovim file explorer: edit your filesystem like a buffer
MIT License
3.84k stars 110 forks source link

Add option to open in float by default #312

Closed nihancj closed 3 months ago

nihancj commented 7 months ago

set to true, Oil will open in float mode when :Oil command is used

Solves #298

nihancj commented 7 months ago

Making this work on :e . does seem hard. Would you be able to give some thoughts on where to start?

Also what about adding a :Oil --normal flag that opens oil in normal window mode.

stevearc commented 7 months ago

Well this is where we switch the buffer from path/to/file to oil://path/to/file https://github.com/stevearc/oil.nvim/blob/29a06fcc906f57894c1bc768219ba590e03d1121/lua/oil/init.lua#L687-L690

You would have to somehow instead restore whatever the previous buffer was in this window (might be difficult or impossible if the buffer had bufhidden=wipe), then open the floating oil win.

Instead of --normal I think --no-float would be better.