Skip to content

Commit 2ea0d6b

Browse files
author
github-actions
committed
[docgen] Update doc/orgmode.txt
skip-checks: true
1 parent 12809f9 commit 2ea0d6b

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

doc/orgmode.txt

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,39 @@ Should error diagnostics be shown. If you are using Neovim 0.6.0 or higher, thes
252252

253253
WIN_SPLIT_MODE *orgmode-win_split_mode*
254254

255-
type: `string`
255+
type: `string|function`
256256
default value: `horizontal`
257257
Available options:
258258
* horizontal - Always split horizontally
259259
* vertical - Always split vertically
260260
* auto - Determine between horizontal and vertical split depending on the current window size
261261

262262
This option determines how to open agenda and capture window.
263-
If none of the options above suit your needs, you can provide custom command (see `:help <mods>`). Here are few examples:
263+
If none of the options above suit your needs, you can provide custom command string (see `:help <mods>`) or custom function:
264+
Here are few examples:
265+
266+
Open in float window:
267+
>
268+
win_split_mode = function(name)
269+
local bufnr = vim.api.nvim_create_buf(false, true)
270+
--- Setting buffer name is required
271+
vim.api.nvim_buf_set_name(bufnr, name)
272+
local fill = 0.8
273+
local width = math.floor((vim.o.columns * fill))
274+
local height = math.floor((vim.o.lines * fill))
275+
local row = math.floor((((vim.o.lines - height) / 2) - 1))
276+
local col = math.floor(((vim.o.columns - width) / 2))
277+
vim.api.nvim_open_win(bufnr, true, {
278+
relative = "editor",
279+
width = width,
280+
height = height,
281+
row = row,
282+
col = col,
283+
style = "minimal",
284+
border = "rounded"
285+
})
286+
end
287+
<
264288

265289
Always open in tab:
266290
>

0 commit comments

Comments
 (0)