stevearc / oil.nvim

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

feature request: Add option to specify preview split direction #304

Closed omerchn closed 7 months ago

omerchn commented 8 months ago

Did you check existing requests?

Describe the feature

A preview.split_direction option to specify in which direction the preview split (<C-p>) opens

Provide background

When I opened the preview split with <C-p> it always used to open to the right, but now after updating Oil it always opens to the left 🤔 I would really appreciate the option to specify the direction. Thank you!

What is the significance of this feature?

nice to have

Additional details

No response

omerchn commented 8 months ago

I also noticed now that the <C-s> functionality also flipped - the vertical split is created to the left instead of the right 🤔 Is this expected?

omerchn commented 7 months ago

closing this as I no longer use oil

dudicoco commented 7 months ago

@stevearc can we reopen this please? I'm also interested in this feature.

moyukhc commented 7 months ago

+1 to re-opening this request, I'd love to be able to tile my preview windows from NE as opposed to NW splits. I think you could just expose the nvim_open_win.anchor [parameter](https://neovim.io/doc/user/api.html#nvim_open_win()) from the neovim API docs?

Many thanks!

Florian-Merle commented 6 months ago

Setting vim.opt.splitright = true works. See https://github.com/stevearc/oil.nvim/blob/master/lua/oil/init.lua#L471

Ideally, it would be great to have an oil option for that though