Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/orgmode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Available `string` values:
- `vertical` - Always split vertically
- `auto` - Determine between horizontal and vertical split depending on the current window size
- `float` - Open in float window that has width of 70% of the screen centered
- `edit` - Open in the current window
- `tabnew` - Open in a new tab
- `{'float', 0.9}` - Open in float window and provide custom scale (in this case it's 90% of screen size), must be value between `0` and `1`

If none of the options above suit your needs, there are 2 other ways to
Expand Down
2 changes: 1 addition & 1 deletion lua/orgmode/config/_meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
---@field org_id_link_to_org_use_id? boolean If true, Storing a link to the headline will automatically generate ID for that headline. Default: false
---@field org_use_property_inheritance boolean | string | string[] If true, properties are inherited by sub-headlines; may also be a regex or list of property names. Default: false
---@field org_babel_default_header_args? table<string, string> Default header args for org-babel blocks: Default: { [':tangle'] = 'no', [':noweb'] = 'no' }
---@field win_split_mode? 'horizontal' | 'vertical' | 'auto' | 'float' | string[] How to open agenda and capture windows. Default: 'horizontal'
---@field win_split_mode? 'horizontal' | 'vertical' | 'auto' | 'float' | 'edit' | 'tabnew' | string[] How to open agenda and capture windows. Default: 'horizontal'
---@field win_border? 'none' | 'single' | 'double' | 'rounded' | 'solid' | 'shadow' | string[] Border configuration for `win_split_mode = 'float'`. Default: 'single'
---@field notifications? OrgNotificationsConfig Notification settings
---@field mappings? OrgMappingsConfig Mappings configuration
Expand Down
4 changes: 3 additions & 1 deletion lua/orgmode/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,14 @@ end

---@param name string
---@param height number
---@param split_mode string|function|table
---@param split_mode 'horizontal'|'vertical'|'auto'|'float'|'edit'|'tabnew'|string|function|{string,number}
---@param border string|table
function utils.open_window(name, height, split_mode, border)
local cmd_by_split_mode = {
horizontal = string.format('%dsplit %s', height, name),
vertical = string.format('vsplit %s', name),
edit = string.format('edit %s', name),
tabnew = string.format('tabnew %s', name),
}

if cmd_by_split_mode[split_mode] then
Expand Down