Open onexbash opened 2 months ago
Layouting stuff has unbounded complexity and you can code your own split behavior, so from my point of view, this does not belong into the plugin.
You can script your own solution with something like
local has_oil, oil = pcall(require, 'oil')
local has_myoil, myoil = pcall(require, 'my_oil')
if has_oil then
assert(has_myoil)
add_cmd('ODabs', function() setPlusAnd0Register(oil.get_current_dir()) end, {})
add_cmd('ODrel', function() setPlusAnd0Register('.' .. sep .. plenary.path:new(oil.get_current_dir()):make_relative() .. sep) end, {})
add_cmd('OFabs', function() setPlusAnd0Register(oil.get_current_dir() .. oil.get_cursor_entry().parsed_name) end, {})
add_cmd('OFrel', function() setPlusAnd0Register('.' .. sep .. plenary.path:new(oil.get_current_dir()):make_relative() .. sep .. oil.get_cursor_entry().parsed_name) end, {})
end
and keep track of your window layouts with positions and splits yourself. Vim and Neovim unfortunately offer no API for sane window positioning and the session file neither looks great (a bunch of hard to decipher splits with vimscript).
Some more code to reuse
Did you check existing requests?
Describe the feature
Hi all, I added a keymap that always opens Oil in a vertical split on the left. Now I want to open the selected buffer in the next split to the right and create a new split if there is none. I know that I can pass vertical = true to oil.select() but unfortunately it doesnt check if there already is an open split on the right. Is it possible to achieve this?
This screenshot shows my config + the opening behaviour with oil on the left site:
Provide background
I'm trying to have a similar experience to NvimTree in Oil.
What is the significance of this feature?
cannot use this plugin without it
Additional details
No response