feat: API to automatically open preview window after opening oil (#339)

This commit is contained in:
Steven Arcangeli 2025-01-24 15:09:36 -08:00
parent 52f1683c76
commit 57528bf9c5
6 changed files with 135 additions and 31 deletions

View file

@ -304,12 +304,20 @@ get_current_dir({bufnr}): nil|string *oil.get_current_di
Parameters:
{bufnr} `nil|integer`
open_float({dir}) *oil.open_float*
open_float({dir}, {opts}, {cb}) *oil.open_float*
Open oil browser in a floating window
Parameters:
{dir} `nil|string` When nil, open the parent of the current buffer, or the
cwd if current buffer is not a file
{dir} `nil|string` When nil, open the parent of the current buffer, or
the cwd if current buffer is not a file
{opts} `nil|oil.OpenOpts`
{preview} `nil|oil.OpenPreviewOpts` When present, open the preview
window after opening oil
{vertical} `nil|boolean` Open the buffer in a vertical split
{horizontal} `nil|boolean` Open the buffer in a horizontal split
{split} `nil|"aboveleft"|"belowright"|"topleft"|"botright"` S
plit modifier
{cb} `nil|fun()` Called after the oil buffer is ready
toggle_float({dir}) *oil.toggle_float*
Open oil browser in a floating window, or close it if open
@ -318,12 +326,20 @@ toggle_float({dir}) *oil.toggle_floa
{dir} `nil|string` When nil, open the parent of the current buffer, or the
cwd if current buffer is not a file
open({dir}) *oil.open*
open({dir}, {opts}, {cb}) *oil.open*
Open oil browser for a directory
Parameters:
{dir} `nil|string` When nil, open the parent of the current buffer, or the
cwd if current buffer is not a file
{dir} `nil|string` When nil, open the parent of the current buffer, or
the cwd if current buffer is not a file
{opts} `nil|oil.OpenOpts`
{preview} `nil|oil.OpenPreviewOpts` When present, open the preview
window after opening oil
{vertical} `nil|boolean` Open the buffer in a vertical split
{horizontal} `nil|boolean` Open the buffer in a horizontal split
{split} `nil|"aboveleft"|"belowright"|"topleft"|"botright"` S
plit modifier
{cb} `nil|fun()` Called after the oil buffer is ready
close({opts}) *oil.close*
Restore the buffer that was present when oil was opened