You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xplr/docs/en/src/general-config.md

9.3 KiB

General Config

This configuration is exposed via the xplr.config.general API. It contains the following fields:

enable_mouse

Type: boolean

Set it to true enable scrolling using mouse.

show_hidden

Type: boolean

Set it to true to show hidden files.

read_only

Type: boolean

Set it to true to use only a subset of selected operations that forbids executing commands or performing write operations on the file-system.

enable_recover_mode

Type: boolean

Set it to true if you want to enable a safety feature that will save you from yourself when you type recklessly.

cursor.format

Type: nullable string

This is the shape of the cursor visible when the input buffer contains some string.

cursor.style

Type: Style

Style of the cursor.

initial_layout

Type: string

The name of one of the layout to use when xplr loads.

initial_mode

Type: string

The name of one of the mode to use when xplr loads.

initial_sorting

Type: list of Node Sorter Applicable

Initial group if sorters applied to the nodes list in the table.

table.style

Type: Style

Default style of the table.

table.col_spacing

Type: nullable integer

Default spacing of the columns in the table.

table.col_widths

Type: nullable list of Constraint

Width of each column in the table.

table.header.height

Type: nullable integer

Height of the table header.

table.header.style

Type: Style

Style of table header.

table.header.cols

Type: list of column configuration

Each column config contains format field (string) and style field (Style), that define the content and style of header.

table.row.height

Type: nullable integer

Height of each row in the table.

table.row.style

Type: Style

Style of table rows.

table.row.cols

Type: list of column configuration

Each column config contains format field (string) and style field (Style).

However, unlike table.header.cols, the format field here points to a column renderer function.

table.tree

Type: list of tree configuration

It expects a list of three items. The first component of the tree, then the middle components, and finally the last component of the tree.

Each item requires the format field which is a string, and the style field, which is the Style object.

Example:

xplr.config.general.table.tree = {
    { format = "├─", style = { add_modifiers = { "Bold" }, bg = nil, fg = "Blue", sub_modifiers = nil } },
    { format = "├─", style = { add_modifiers = { "Bold" }, bg = nil, fg = "Blue", sub_modifiers = nil } },
    { format = "╰─", style = { add_modifiers = { "Bold" }, bg = nil, fg = "Blue", sub_modifiers = nil } },
}

start_fifo

Type: nullable string

Start a FIFO file when xplr loads. It will track the absolute path of the file under focus.

prompt.format

Type: string

This is the shape of the prompt for the input buffer.

prompt.style

Type: Style

Style of the input prompt.

logs.error.format

Type: string

The string to indicate an error in logs.

logs.error.style

Type: Style

Style for errors shown in logs.

logs.info.format

Type: string

The string to indicate an information in logs.

logs.info.style

Type: Style

Style for infos shown in logs.

logs.success.format

Type: string

The string to indicate a successful operation in logs.

logs.success.style

Type: Style

Style for successful operations in logs.

logs.warning.format

Type: string

The string that indicates a warning in logs.

logs.warning.style

Type: Style

Style for warnings in logs.

default_ui.prefix

Type: nullable string

The content that is placed before the item name for each row.

default_ui.suffix

Type: nullable string

The content which is appended to each item name for each row.

default_ui.style

Type: Style

Style for the default user interface.

focus_ui.prefix

Type: nullable string

The string placed before the item name for a focused row.

focus_ui.suffix

Type: nullable string

The string placed after the item name for a focused row.

focus_ui.style

Type: Style

Style for focused elements.

selection_ui.prefix

Type: nullable string

The string that is placed before the item name for a selected row.

selection_ui.suffix

Type: nullable string

The string placed after the item name for a selected row.

selection_ui.style

Type: Style

Style for selected rows.

focus_selection_ui.prefix

Type: nullable string

The string placed before item name for a selected row that gets the focus.

focus_selection_ui.suffix

Type: nullable string

The string placed after the item name for a selected row that gets the focus.

focus_selection_ui.style

Type: Style

Style for a selected row that gets the focus.

sort_and_filter_ui.separator.format

Type: nullable string

The shape of the separator for the Sort & filter panel.

sort_and_filter_ui.separator.style

Type: Style

Style for Sort & filter panel separator.

sort_and_filter_ui.default_identifier.format

Type: nullable string

The content of the default identifier in Sort & filter panel.

sort_and_filter_ui.default_identifier.style

Type: Style

Style for the default identifier in Sort & filter panel.

sort_and_filter_ui.filter_identifiers

Type: Table with filter name as key

The value contains format field (string) and style field (Style), that define the content and style for the given filter.

Example:

xplr.config.general.sort_and_filter_ui.filter_identifiers.AbsolutePathDoesContain = {
  format = "abs=~",
  style = { add_modifiers = { "Bold" }, bg = nil, fg = nil, sub_modifiers = nil },
}

sort_and_filter_ui.sort_direction_identifiers.forward.format

Type: nullable string

The shape of the forward direction indicator for sort identifiers in Sort & filter panel.

sort_and_filter_ui.sort_direction_identifiers.forward.style

Type: Style

Style of forward direction indicator.

sort_and_filter_ui.sort_direction_identifiers.reverse.format

Type: nullable string

The shape of the reverse direction indicator for sort identifiers in Sort & filter panel.

sort_and_filter_ui.sort_direction_identifiers.reverse.style

Type: Style

Style of reverse direction indicator.

sort_and_filter_ui.sorter_identifiers

Type: Table with sorter name as key

The value contains format field (string) and style field (Style), that define the content and style for the given sorter.

Example:

sort_and_filter_ui.sorter_identifiers.ByCanonicalAbsolutePath = {
  format = "[c]abs",
  style = { add_modifiers = nil, bg = nil, fg = "Yellow", sub_modifiers = nil },
}

panel_ui.default.borders

Type: nullable list of strings

Defines where to show borders for the panels.

The possible values are any combination of: "Top", "Bottom", "Left" and "Right".

Example:

-- Show Left and Right borders only
xplr.config.general.panel_ui.default.borders = {
  "Right",
  "Left",
}

panel_ui.default.style

Type: Style

Default style for panels.

panel_ui.default.title.format

Type: nullable string

The content for panel title.

panel_ui.default.title.style

Type: Style

Style for panel title.

panel_ui.help_menu.borders

Type: nullable list of strings

Defines where to show borders for the Help panel.

The possible values are any combination of: "Top", "Bottom", "Left" and "Right".

panel_ui.help_menu.style

Type: Style

Style for Help panel.

panel_ui.help_menu.title.format

Type: nullable string

The content for Help panel title.

panel_ui.help_menu.title.style

Type: Style

Style for Help panel title.

panel_ui.input_and_logs.borders

Type: nullable list of strings

Defines where to show borders for the Input & Logs panel.

The possible values are any combination of: "Top", "Bottom", "Left" and "Right".

panel_ui.input_and_logs.style

Type: Style

Style for Input & Logs panel.

panel_ui.input_and_logs.title.format

Type: nullable string

The content for the Input and Logs panel title.

panel_ui.input_and_logs.title.style

Type: Style

Style for Input & Logs panel title.

panel_ui.selection.borders

Type: nullable list of strings

Defines where to show borders for the Selection panel.

The possible values are any combination of: "Top", "Bottom", "Left" and "Right".

panel_ui.selection.style

Type: Style

Style for Selection panel.

panel_ui.selection.title.format

Type: nullable string

The content for Selection panel title.

panel_ui.selection.title.style

Type: Style

Style for Selection panel title.

panel_ui.sort_and_filter.borders

Type: nullable list of strings

Defines where to show borders for the Sort & filter panel.

The possible values are any combination of: "Top", "Bottom", "Left" and "Right".

panel_ui.sort_and_filter.style

Type: Style

Style for Sort & filter panel.

panel_ui.sort_and_filter.title.format

Type: nullable string

The content for Sort & filter panel title.

panel_ui.sort_and_filter.title.style

Type: Style

Style for Sort & filter panel title.