Auto generate docs

pull/462/head
Arijit Basu 2 years ago committed by Arijit Basu
parent 88b79643cb
commit 0472bc3e66

@ -1,10 +1,10 @@
# Configuration
xplr can be configured using [Lua][3] via a special file named `init.lua`,
xplr can be configured using [Lua][1] via a special file named `init.lua`,
which can be placed in `~/.config/xplr/` (local to user) or `/etc/xplr/`
(global) depending on the use case.
When xplr loads, it first executes the [built-in init.lua][1] to set the
When xplr loads, it first executes the [built-in init.lua][2] to set the
default values, which is then overwritten by another config file, if found
using the following lookup order:
@ -17,9 +17,60 @@ The first one found will be loaded by xplr and the lookup will stop.
The loaded config can be further extended using the `-C` or `--extra-config`
command-line option.
> **NEED HELP:** Auto generate rest of the docs from [src/init.lua][1]
> using [docs/script/generate.py][2].
[1]: https://www.lua.org
[2]: https://github.com/sayanarijit/xplr/blob/main/src/init.lua
[3]: https://xplr.dev/en/upgrade-guide
[1]: https://github.com/sayanarijit/xplr/blob/main/src/init.lua
[2]: https://github.com/sayanarijit/xplr/blob/main/docs/script/generate.py
[3]: https://www.lua.org
## Config
The xplr configuration, exposed via `xplr.config` Lua API contains the
following sections.
See:
- [xplr.config.general](https://xplr.dev/en/general-config)
- [xplr.config.node_types](https://xplr.dev/en/node_types)
- [xplr.config.layouts](https://xplr.dev/en/layouts)
- [xplr.config.modes](https://xplr.dev/en/modes)
## Function
While `xplr.config` defines all the static parts of the configuration,
`xplr.fn` defines all the dynamic parts using functions.
See: [Lua Function Calls](https://xplr.dev/en/lua-function-calls)
### Builtin Functions
As always, `xplr.fn.builtin` is where the built-in functions are defined
that can be overwritten.
#### xplr.fn.builtin.fmt_general_table_row_cols_0
Renders the first column in the table
#### xplr.fn.builtin.fmt_general_table_row_cols_1
Renders the second column in the table
#### xplr.fn.builtin.fmt_general_table_row_cols_2
Renders the third column in the table
#### xplr.fn.builtin.fmt_general_table_row_cols_3
Renders the fourth column in the table
#### xplr.fn.builtin.fmt_general_table_row_cols_4
Renders the fifth column in the table
### Custom Functions
This is where the custom functions can be added.
There is currently no restriction on what kind of functions can be defined
in `xplr.fn.custom`.
You can also use nested tables such as
`xplr.fn.custom.my_plugin.my_function` to define custom functions.

@ -1,11 +1,562 @@
# General Config
### General Configuration
This configuration is exposed via the `xplr.config.general` API.
The general configuration properties are grouped together in
`xplr.config.general`.
For now, kindly refer to [**init.lua**][1]
#### xplr.config.general.disable_debug_error_mode
> **NEED HELP:** Auto generate rest of the docs from [src/init.lua][1]
> using [docs/script/generate.py][2].
Set it to `true` if you want to ignore the startup errors. You can still see
the errors in the logs.
[1]: https://github.com/sayanarijit/xplr/blob/main/src/init.lua
[2]: https://github.com/sayanarijit/xplr/blob/main/docs/script/generate.py
Type: boolean
#### xplr.config.general.enable_mouse
Set it to `true` if you want to enable mouse scrolling.
Type: boolean
#### xplr.config.general.show_hidden
Set it to `true` to show hidden files by default.
Type: boolean
#### xplr.config.general.read_only
Set it to `true` to use only a subset of selected operations that forbids
executing commands or performing write operations on the file-system.
Type: boolean
#### xplr.config.general.enable_recover_mode
Set it to `true` if you want to enable a safety feature that will save you
from yourself when you type recklessly.
Type: boolean
#### xplr.config.general.hide_remaps_in_help_menu
Set it to `true` if you want to hide all remaps in the help menu.
Type: boolean
#### xplr.config.general.enforce_bounded_index_navigation
Set it to `true` if you want the cursor to stay in the same position when
the focus is on the first path and you navigate to the previous path
(by pressing `up`/`k`), or when the focus is on the last path and you
navigate to the next path (by pressing `down`/`j`).
The default behavior is to rotate from the last/first path.
Type: boolean
#### xplr.config.general.prompt.format
This is the shape of the prompt for the input buffer.
Type: nullable string
#### xplr.config.general.prompt.style
This is the style of the prompt for the input buffer.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.logs.info.format
The string to indicate an information in logs.
Type: nullable string
#### xplr.config.general.logs.info.style
The style for the informations logs.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.logs.success.format
The string to indicate an success in logs.
Type: nullable string
#### xplr.config.general.logs.success.style
The style for the success logs.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.logs.warning.format
The string to indicate an warnings in logs.
Type: nullable string
#### xplr.config.general.logs.warning.style
The style for the warnings logs.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.logs.error.format
The string to indicate an error in logs.
Type: nullable string
#### xplr.config.general.logs.error.style
The style for the error logs.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.table.header.cols
Columns to display in the table header.
Type: nullable list of tables with the following fields:
- format: nullable string
- style: [Style](https://xplr.dev/en/style)
#### xplr.config.general.table.header.style
Style of the table header.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.table.header.height
Height of the table header.
Type: nullable integer
#### xplr.config.general.table.row.cols
Columns to display in each row in the table.
Type: nullable list of tables with the following fields:
- format: nullable string
- style: [Style](https://xplr.dev/en/style)
#### xplr.config.general.table.row.style
Default style of the table.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.table.row.height
Height of the table rows.
Type: nullable integer
#### xplr.config.general.table.style
Default style of the table.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.table.tree
Tree to display in the table.
Type: nullable list of tables with the following fields:
- format: nullable string
- style: [Style](https://xplr.dev/en/style)
#### xplr.config.general.table.col_spacing
Spacing between the columns in the table.
Type: nullable integer
#### xplr.config.general.table.col_widths
Constraint for the column widths.
Type: nullable list of [Constraint](https://xplr.dev/en/layouts#constraint)
#### xplr.config.general.default_ui.prefix
The content that is placed before the item name for each row by default.
Type: nullable string
#### xplr.config.general.default_ui.suffix
The content which is appended to each item name for each row by default.
Type: nullable string
#### xplr.config.general.default_ui.style
The default style of each item for each row.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.focus_ui.prefix
The string placed before the item name for a focused row.
Type: nullable string
#### xplr.config.general.focus_ui.suffix
The string placed after the item name for a focused row.
Type: nullable string
#### xplr.config.general.focus_ui.style({
Style for focused item.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.selection_ui.prefix
The string placed before the item name for a selected row.
Type: nullable string
#### xplr.config.general.selection_ui.suffix
The string placed after the item name for a selected row.
Type: nullable string
#### xplr.config.general.selection_ui.style
Style for selected rows.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.focus_selection_ui.prefix
The string placed before item name for a selected row that gets the focus.
Type: nullable string
#### xplr.config.general.focus_selection_ui.suffix
The string placed after the item name for a selected row that gets the focus.
Type: nullable string
#### xplr.config.general.focus_selection_ui.style
Style for a selected row that gets the focus.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.sort_and_filter_ui.separator.format
The shape of the separator for the Sort & filter panel.
Type: nullable string
#### xplr.config.general.sort_and_filter_ui.separator.style
The style of the separator for the Sort & filter panel.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.sort_and_filter_ui.default_identifier.format
The content of the default identifier in Sort & filter panel.
Type: nullable string
#### xplr.config.general.sort_and_filter_ui.default_identifier.style
Style for the default identifier in Sort & filter panel.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.forward.format
The shape of the forward direction indicator for sort identifiers in Sort & filter panel.
Type: nullable string
#### xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.forward.style
Style of forward direction indicator in Sort & filter panel.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.format
The shape of the reverse direction indicator for sort identifiers in Sort & filter panel.
Type: nullable string
#### xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.style
Style of reverse direction indicator in Sort & filter panel.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.sort_and_filter_ui.sorter_identifiers
The identifiers used to denote applied sorters in the Sort & filter panel.
Type: nullable mapping of the following key-value pairs:
- key: [Sorter](https://xplr.dev/en/sorting#sorter)
- value:
- format: nullable string
- style: [Style][https://xplr.dev/en/style]
#### xplr.config.general.sort_and_filter_ui.filter_identifiers
The identifiers used to denote applied filters in the Sort & filter panel.
Type: nullable mapping of the following key-value pairs:
- key: [Filter](https://xplr.dev/en/filtering#filter)
- value:
- format: nullable string
- style: [Style][https://xplr.dev/en/style]
#### xplr.config.general.panel_ui.default.title.format
The content for panel title by default.
Type: nullable string
#### xplr.config.general.panel_ui.default.title.style
The style for panel title by default.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.default.style
Style of the panels by default.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.default.borders
Defines where to show borders for the panels by default.
Type: nullable list of [Border](https://xplr.dev/en/borders#border)
#### xplr.config.general.panel_ui.default.border_type
Type of the borders by default.
Type: nullable [Border Type](https://xplr.dev/en/borders#border-type)
#### xplr.config.general.panel_ui.default.border_style
Style of the panel borders by default.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.table.title.format
The content for the table panel title.
Type: nullable string
#### xplr.config.general.panel_ui.table.title.style
Style of the table panel title.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.table.style
Style of the table panel.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.table.borders
Defines where to show borders for the table panel.
Type: nullable list of [Border](https://xplr.dev/en/borders#border)
#### xplr.config.general.panel_ui.table.border_type
Type of the borders for table panel.
Type: nullable [Border Type](https://xplr.dev/en/borders#border-type)
#### xplr.config.general.panel_ui.table.border_style
Style of the table panel borders.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.help_menu.title.format
The content for the help menu panel title.
Type: nullable string
#### xplr.config.general.panel_ui.help_menu.title.style
Style of the help menu panel title.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.help_menu.style
Style of the help menu panel.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.help_menu.borders
Defines where to show borders for the help menu panel.
Type: nullable list of [Border](https://xplr.dev/en/borders#border)
#### xplr.config.general.panel_ui.help_menu.border_type
Type of the borders for help menu panel.
Type: nullable [Border Type](https://xplr.dev/en/borders#border-type)
#### xplr.config.general.panel_ui.help_menu.border_style
Style of the help menu panel borders.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.input_and_logs.title.format
The content for the input & logs panel title.
Type: nullable string
#### xplr.config.general.panel_ui.input_and_logs.title.style
Style of the input & logs panel title.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.input_and_logs.borders
#### xplr.config.general.panel_ui.input_and_logs.style
Style of the input & logs panel.
Type: [Style](https://xplr.dev/en/style)
Defines where to show borders for the input & logs panel.
Type: nullable list of [Border](https://xplr.dev/en/borders#border)
#### xplr.config.general.panel_ui.input_and_logs.border_type
Type of the borders for input & logs panel.
Type: nullable [Border Type](https://xplr.dev/en/borders#border-type)
#### xplr.config.general.panel_ui.input_and_logs.border_style
Style of the input & logs panel borders.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.selection.title.format
The content for the selection panel title.
Type: nullable string
#### xplr.config.general.panel_ui.selection.title.style
Style of the selection panel title.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.selection.borders
#### xplr.config.general.panel_ui.selection.style
Style of the selection panel.
Type: [Style](https://xplr.dev/en/style)
Defines where to show borders for the selection panel.
Type: nullable list of [Border](https://xplr.dev/en/borders#border)
#### xplr.config.general.panel_ui.selection.border_type
Type of the borders for selection panel.
Type: nullable [Border Type](https://xplr.dev/en/borders#border-type)
#### xplr.config.general.panel_ui.selection.border_style
Style of the selection panel borders.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.sort_and_filter.title.format
The content for the sort & filter panel title.
Type: nullable string
#### xplr.config.general.panel_ui.sort_and_filter.title.style
Style of the sort & filter panel title.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.sort_and_filter.style
Style of the sort & filter panel.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.panel_ui.sort_and_filter.borders
Defines where to show borders for the sort & filter panel.
Type: nullable list of [Border](https://xplr.dev/en/borders#border)
#### xplr.config.general.panel_ui.sort_and_filter.border_type
Type of the borders for sort & filter panel.
Type: nullable [Border Type](https://xplr.dev/en/borders#border-type)
#### xplr.config.general.panel_ui.sort_and_filter.border_style
Style of the sort & filter panel borders.
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.general.initial_sorting
Initial group if sorters applied to the nodes list in the table.
Type: nullable list of [Node Sorter](https://xplr.dev/en/sorting#node-sorter-applicable)
#### xplr.config.general.initial_mode
The name of one of the modes to use when xplr loads.
Type: nullable string
#### xplr.config.general.initial_layout
The name of one of the layouts to use when xplr loads.
Type: nullable string
#### xplr.config.general.start_fifo
Set it to a file path to start fifo when xplr loads.
Generally it is used to integrate with external tools like previewers.
Type: nullable string

@ -1,11 +1,75 @@
# Layouts
### Layouts
This configuration is exposed via the `xplr.config.layouts` API.
xplr layouts define the structure of the UI, i.e. how many panel we see,
placement and size of the panels, how they look etc.
For now, kindly refer to [**init.lua**][1]
This is configuration exposed via the `xplr.config.layouts` API.
> **NEED HELP:** Auto generate rest of the docs from [src/init.lua][1]
> using [docs/script/generate.py][2].
`xplr.config.layouts.builtin` contain some built-in panels which can be
overridden, but you can't add or remove panels in it.
[1]: https://github.com/sayanarijit/xplr/blob/main/src/init.lua
[2]: https://github.com/sayanarijit/xplr/blob/main/docs/script/generate.py
You can add new panels in `xplr.config.layouts.custom`.
##### Example: Defining Custom Layout
![demo](https://s6.gifyu.com/images/layout.png)
```lua
xplr.config.layouts.builtin.default = {
Horizontal = {
config = {
margin = 1,
horizontal_margin = 2,
vertical_margin = 3,
constraints = {
{ Percentage = 50 },
{ Percentage = 50 },
}
},
splits = {
"Table",
"HelpMenu",
}
}
}
```
#### xplr.config.layouts.builtin.default
The default layout
Type: [Layout](https://xplr.dev/en/layout)
#### xplr.config.layouts.builtin.no_help
The layout without help menu
Type: [Layout](https://xplr.dev/en/layout)
#### xplr.config.layouts.builtin.no_selection
The layout without selection panel
Type: [Layout](https://xplr.dev/en/layout)
#### xplr.config.layouts.builtin.no_help_no_selection
The layout without help menu and selection panel
Type: [Layout](https://xplr.dev/en/layout)
#### xplr.config.layouts.custom
This is where you can define custom layouts
Type: mapping of the following key-value pairs:
- key: string
- value: [Layout](https://xplr.dev/en/layout)
Example:
```lua
xplr.config.layouts.custom.example = "Nothing" -- Show a blank screen
xplr.config.general.initial_layout = "example" -- Load the example layout
```

@ -25,7 +25,6 @@ xplr messages categorized based on their purpose.
#### ExplorePwd
Explore the present working directory and register the filtered nodes.
This operation is expensive. So, try to avoid using it too often.
@ -36,7 +35,6 @@ Example:
#### ExplorePwdAsync
Explore the present working directory and register the filtered nodes
asynchronously. This operation happens asynchronously. That means, the
xplr directory buffers won't be updated immediately. Hence, it needs to
@ -50,7 +48,6 @@ Example:
#### ExploreParentsAsync
Explore the present working directory along with its parents and
register the filtered nodes. This operation happens asynchronously.
That means, the xplr directory buffers won't be updated immediately.
@ -67,7 +64,6 @@ Example:
#### ClearScreen
Clear the screen.
Example:
@ -77,7 +73,6 @@ Example:
#### Refresh
Refresh the screen.
But it will not re-explore the directory if the working directory is
the same. If there is some change in the working directory and you want
@ -93,7 +88,6 @@ Example:
#### FocusNext
Focus next node.
Example:
@ -103,7 +97,6 @@ Example:
#### FocusNextByRelativeIndex
Focus on the `n`th node relative to the current focus where `n` is a
given value.
@ -116,7 +109,6 @@ Example:
#### FocusNextByRelativeIndexFromInput
Focus on the `n`th node relative to the current focus where `n` is read
from the input buffer.
@ -127,7 +119,6 @@ Example:
#### FocusPrevious
Focus on the previous item.
Example:
@ -137,7 +128,6 @@ Example:
#### FocusPreviousByRelativeIndex
Focus on the `-n`th node relative to the current focus where `n` is a
given value.
@ -150,7 +140,6 @@ Example:
#### FocusPreviousByRelativeIndexFromInput
Focus on the `-n`th node relative to the current focus where `n` is
read from the input buffer.
@ -161,7 +150,6 @@ Example:
#### FocusFirst
Focus on the first node.
Example:
@ -169,19 +157,17 @@ Example:
- Lua: "FocusFirst"
- YAML: `FocusFirst`
#### FocusLast
Focus on the last node.
Example:
- Lua: "FocusLast"
- Lua: "FocusLast"
- YAML: `FocusLast`
#### FocusPath
Focus on the given path.
Type: { FocusPath = "string" }
@ -193,7 +179,6 @@ Example:
#### FocusPathFromInput
Focus on the path read from input buffer.
Example:
@ -203,7 +188,6 @@ Example:
#### FocusByIndex
Focus on the absolute `n`th node where `n` is a given value.
Type: { FocusByIndex = int }
@ -215,7 +199,6 @@ Example:
#### FocusByIndexFromInput
Focus on the absolute `n`th node where `n` is read from the input buffer.
Example:
@ -225,8 +208,6 @@ Example:
#### FocusByFileName
**YAML:** `FocusByFileName: string`
Focus on the file by name from the present working directory.
@ -240,7 +221,6 @@ Example:
#### ChangeDirectory
Change the present working directory ($PWD)
Type: { ChangeDirectory = "string" }
@ -252,7 +232,6 @@ Example:
#### Enter
Enter into the currently focused path if it's a directory.
Example:
@ -262,7 +241,6 @@ Example:
#### Back
Go back to the parent directory.
Example:
@ -272,7 +250,6 @@ Example:
#### LastVisitedPath
Go to the last path visited.
Example:
@ -282,7 +259,6 @@ Example:
#### NextVisitedPath
Go to the next path visited.
Example:
@ -292,8 +268,6 @@ Example:
#### FollowSymlink
Follow the symlink under focus to its actual location.
Example:
@ -305,7 +279,6 @@ YAML: `FollowSymlink`
#### UpdateInputBuffer
Update the input buffer using cursor based operations.
Type: { UpdateInputBuffer = [Input Opertaion](https://xplr.dev/en/input-operation) }
@ -317,7 +290,6 @@ Example:
#### UpdateInputBufferFromKey
Update the input buffer from the key read from keyboard input.
Example:
@ -327,7 +299,6 @@ Example:
#### BufferInput
Append/buffer the given string into the input buffer.
Type: { BufferInput = "string" }
@ -339,7 +310,6 @@ Example:
#### BufferInputFromKey
Append/buffer the characted read from a keyboard input into the
input buffer.
@ -350,7 +320,6 @@ Example:
#### SetInputBuffer
Set/rewrite the input buffer with the given string.
When the input buffer is not-null (even if empty string)
it will show in the UI.
@ -364,7 +333,6 @@ Example:
#### RemoveInputBufferLastCharacter
Remove input buffer's last character.
Example:
@ -374,7 +342,6 @@ Example:
#### RemoveInputBufferLastWord
Remove input buffer's last word.
Example:
@ -384,7 +351,6 @@ Example:
#### ResetInputBuffer
Reset the input buffer back to null. It will not show in the UI.
Example:
@ -396,7 +362,6 @@ Example:
#### SwitchMode
Switch input [mode](https://xplr.dev/en/modes).
Type : { SwitchMode = "string" }
@ -412,7 +377,6 @@ Example:
#### SwitchModeKeepingInputBuffer
Switch input [mode](https://xplr.dev/en/modes).
It keeps the input buffer.
@ -429,7 +393,6 @@ Example:
#### SwitchModeBuiltin
Switch to a [builtin mode](https://xplr.dev/en/modes#builtin).
It clears the input buffer.
@ -442,7 +405,6 @@ Example:
#### SwitchModeBuiltinKeepingInputBuffer
Switch to a [builtin mode](https://xplr.dev/en/modes#builtin).
It keeps the input buffer.
@ -455,7 +417,6 @@ Example:
#### SwitchModeCustom
Switch to a [custom mode](https://xplr.dev/en/modes#custom).
It clears the input buffer.
@ -468,7 +429,6 @@ Example:
#### SwitchModeCustomKeepingInputBuffer
Switch to a [custom mode](https://xplr.dev/en/modes#custom).
It keeps the input buffer.
@ -481,7 +441,6 @@ Example:
#### PopMode
Pop the last mode from the history and switch to it.
It clears the input buffer.
@ -492,7 +451,6 @@ Example:
#### PopModeKeepingInputBuffer
Pop the last mode from the history and switch to it.
It keeps the input buffer.
@ -505,7 +463,6 @@ Example:
#### SwitchLayout
Switch [layout](https://xplr.dev/en/layouts).
Type: { SwitchLayout = "string" }
@ -520,7 +477,6 @@ Example:
#### SwitchLayoutBuiltin
Switch to a [builtin layout](https://xplr.dev/en/layouts#builtin).
Type: { SwitchLayoutBuiltin = "string" }
@ -532,7 +488,6 @@ Example:
#### SwitchLayoutCustom
Switch to a [custom layout](https://xplr.dev/en/layouts#custom).
Type: { SwitchLayoutCustom = "string" }
@ -546,7 +501,6 @@ Example:
#### Call
Call a shell command with the given arguments.
Note that the arguments will be shell-escaped.
So to read the variables, the `-c` option of the shell
@ -562,7 +516,6 @@ Example:
#### CallSilently
Like `Call` but without the flicker. The stdin, stdout
stderr will be piped to null. So it's non-interactive.
@ -575,7 +528,6 @@ Example:
#### BashExec
An alias to `Call: {command: bash, args: ["-c", "{string}"], silent: false}`
where `{string}` is the given value.
@ -588,7 +540,6 @@ Example:
#### BashExecSilently
Like `BashExec` but without the flicker. The stdin, stdout
stderr will be piped to null. So it's non-interactive.
@ -603,7 +554,6 @@ Example:
#### CallLua
Call a Lua function.
A [Lua Context](https://xplr.dev/en/lua-function-calls#lua-context)
@ -620,7 +570,6 @@ Example:
#### CallLuaSilently
Like `CallLua` but without the flicker. The stdin, stdout
stderr will be piped to null. So it's non-interactive.
@ -633,7 +582,6 @@ Example:
#### LuaEval
Execute Lua code without needing to define a function.
If the `string` is a callable, xplr will try to call it with with the
@ -651,7 +599,6 @@ Example:
#### LuaEvalSilently
Like `LuaEval` but without the flicker. The stdin, stdout
stderr will be piped to null. So it's non-interactive.
@ -666,7 +613,6 @@ Example:
#### Select
Select the focused node.
Example:
@ -676,7 +622,6 @@ Example:
#### SelectAll
Select all the visible nodes.
Example:
@ -686,7 +631,6 @@ Example:
#### SelectPath
Select the given path.
Type: { SelectPath = "string" }
@ -698,7 +642,6 @@ Example:
#### UnSelect
Unselect the focused node.
Example:
@ -708,7 +651,6 @@ Example:
#### UnSelectAll
Unselect all the visible nodes.
Example:
@ -718,7 +660,6 @@ Example:
#### UnSelectPath
UnSelect the given path.
Type: { UnSelectPath = "string)" }
@ -730,7 +671,6 @@ Example:
#### ToggleSelection
Toggle selection on the focused node.
Example:
@ -740,7 +680,6 @@ Example:
#### ToggleSelectAll
Toggle between select all and unselect all.
Example:
@ -749,7 +688,6 @@ Example:
#### ToggleSelectionByPath
Toggle selection by file path.
Type: { ToggleSelectionByPath = "string" }
@ -761,7 +699,6 @@ Example:
#### ClearSelection
Clear the selection.
Example:
@ -773,7 +710,6 @@ Example:
#### AddNodeFilter
Add a [filter](https://xplr.dev/en/filtering#filter) to exclude nodes
while exploring directories.
@ -786,7 +722,6 @@ Example:
#### RemoveNodeFilter
Remove an existing [filter](https://xplr.dev/en/filtering#filter).
Type: { RemoveNodeFilter = { filter = [Filter](https://xplr.dev/en/filtering), input = "string" }
@ -798,7 +733,6 @@ Example:
#### ToggleNodeFilter
Remove a [filter](https://xplr.dev/en/filtering#filter) if it exists,
else, add a it.
@ -811,7 +745,6 @@ Example:
#### AddNodeFilterFromInput
Add a node [filter](https://xplr.dev/en/filtering#filter) reading the
input from the buffer.
@ -824,7 +757,6 @@ Example:
#### RemoveNodeFilterFromInput
Remove a node [filter](https://xplr.dev/en/filtering#filter) reading
the input from the buffer.
@ -837,7 +769,6 @@ Example:
#### RemoveLastNodeFilter
Remove the last node [filter](https://xplr.dev/en/filtering).
Example:
@ -847,7 +778,6 @@ Example:
#### ResetNodeFilters
Reset the node [filters](https://xplr.dev/en/filtering) back to the
default configuration.
@ -858,7 +788,6 @@ Example:
#### ClearNodeFilters
Clear all the node [filters](https://xplr.dev/en/filtering).
Example:
@ -870,7 +799,6 @@ Example:
#### AddNodeSorter
Add a [sorter](https://xplr.dev/en/sorting#sorter) to sort nodes while
exploring directories.
@ -883,7 +811,6 @@ Example:
#### RemoveNodeSorter
Remove an existing [sorter](https://xplr.dev/en/sorting#sorter).
Type: { RemoveNodeSorter = [Sorter](https://xplr.dev/en/sorting#sorter) }
@ -895,7 +822,6 @@ Example:
#### ReverseNodeSorter
Reverse a node [sorter](https://xplr.dev/en/sorting#sorter).
Type: { ReverseNodeSorter = [Sorter](https://xplr.dev/en/sorting#sorter) }
@ -907,7 +833,6 @@ Example:
#### ToggleNodeSorter
Remove a [sorter](https://xplr.dev/en/sorting#sorter) if it exists,
else, add a it.
@ -920,7 +845,6 @@ Example:
#### ReverseNodeSorters
Reverse the node [sorters](https://xplr.dev/en/sorting#sorter).
Example:
@ -930,7 +854,6 @@ Example:
#### RemoveLastNodeSorter
Remove the last node [sorter](https://xplr.dev/en/sorting#sorter).
Example:
@ -940,7 +863,6 @@ Example:
#### ResetNodeSorters
Reset the node [sorters](https://xplr.dev/en/sorting#sorter) back to
the default configuration.
@ -951,7 +873,6 @@ Example:
#### ClearNodeSorters
Clear all the node [sorters](https://xplr.dev/en/sorting#sorter).
Example:
@ -963,7 +884,6 @@ Example:
#### EnableMouse
Enable mouse
Example:
@ -973,7 +893,6 @@ Example:
#### DisableMouse
Disable mouse
Example:
@ -983,7 +902,6 @@ Example:
#### ToggleMouse
Toggle mouse
Example:
@ -995,7 +913,6 @@ Example:
#### StartFifo
Start piping the focused path to the given fifo path
Type: { StartFifo = "string" }
@ -1007,7 +924,6 @@ Example:
#### StopFifo
Close the active fifo and stop piping.
Example:
@ -1017,7 +933,6 @@ Example:
#### ToggleFifo
Toggle betwen {Start|Stop}Fifo
Type: { ToggleFifo = "string" }
@ -1031,7 +946,6 @@ Example:
#### LogInfo
Log information message.
Type: { LogInfo = "string" }
@ -1043,7 +957,6 @@ Example:
#### LogSuccess
Log a success message.
Type: { LogSuccess = "String" }
@ -1055,7 +968,6 @@ Example:
#### LogWarning
Log an warning message.
Type: { LogWarning = "string" }
@ -1067,7 +979,6 @@ Example:
#### LogError
Log an error message.
Type: { LogError = "string" }
@ -1081,7 +992,6 @@ Example:
#### Debug
Write the application state to a file, without quitting. Also helpful
for debugging.
@ -1096,7 +1006,6 @@ Example:
#### Quit
Example:
- Lua: "Quit"
@ -1106,7 +1015,6 @@ Quit with returncode zero (success).
#### PrintPwdAndQuit
Print $PWD and quit.
Example:
@ -1116,7 +1024,6 @@ Example:
#### PrintFocusPathAndQuit
Print the path under focus and quit. It can be empty string if there's
nothing to focus.
@ -1127,7 +1034,6 @@ Example:
#### PrintSelectionAndQuit
Print the selected paths and quit. It can be empty is no path is
selected.
@ -1138,7 +1044,6 @@ Example:
#### PrintResultAndQuit
Print the selected paths if it's not empty, else, print the focused
node's path.
@ -1149,7 +1054,6 @@ Example:
#### PrintAppStateAndQuit
Print the state of application in YAML format. Helpful for debugging or
generating the default configuration file.
@ -1160,7 +1064,6 @@ Example:
#### Terminate
Terminate the application with a non-zero return code.
Example:
@ -1168,7 +1071,6 @@ Example:
- Lua: "Terminate"
- YAML: `Terminate`
## Also See:
- [Message](message.md)

@ -1,11 +1,162 @@
# Modes
### Modes
This configuration is exposed via the `xplr.config.modes` API.
xplr is a modal file explorer. That means the users switch between different
modes, each containing a different set of key bindings to avoid clashes.
Users can switch between these modes at run-time.
For now, kindly refer to [**init.lua**][1]
The modes can be configured using the `xplr.config.modes` Lua API.
> **NEED HELP:** Auto generate rest of the docs from [src/init.lua][1]
> using [docs/script/generate.py][2].
`xplr.config.modes.builtin` contain some built-in modes which can be
overridden, but you can't add or remove modes in it.
[1]: https://github.com/sayanarijit/xplr/blob/main/src/init.lua
[2]: https://github.com/sayanarijit/xplr/blob/main/docs/script/generate.py
#### xplr.config.modes.builtin.default
The builtin default mode.
Visit the [Default Key Bindings](https://xplr.dev/en/default-key-bindings)
to see what each mode does.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.debug_error
The builtin debug error mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.recover
The builtin recover mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.selection_ops
The builtin selection ops mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.create
The builtin create mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.create_directory
The builtin create directory mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.create_file
The builtin create file mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.number
The builtin number mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.go_to
The builtin go to mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.rename
The builtin rename mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.duplicate_as
The builtin duplicate as mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.delete
The builtin delete mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.action
The builtin action mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.quit
The builtin quit mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.search
The builtin search mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.filter
The builtin filter mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.relative_path_does_contain
The builtin relative_path_does_contain mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.relative_path_does_not_contain
The builtin relative_path_does_not_contain mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.sort
The builtin sort mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.builtin.switch_layout
The builtin switch layout mode.
Type: [Mode](https://xplr.dev/en/mode)
#### xplr.config.modes.custom
This is where you define custom modes.
Type: mapping of the following key-value pairs:
- key: string
- value: [Mode](https://xplr.dev/en/mode)
Example:
```lua
xplr.config.modes.custom.example = {
name = "example",
key_bindings = {
on_key = {
enter = {
help = "default mode",
messages = {
"PopMode",
{ SwitchModeBuiltin = "default" },
},
},
},
},
}
xplr.config.general.initial_mode = "example"
```

@ -1,11 +1,104 @@
# Node Types
### Node Types
This configuration is exposed via the `xplr.config.node_types` API.
This section defines how to deal with different kinds of nodes (files,
directories, symlinks etc.) based on their properties.
For now, kindly refer to [**init.lua**][1]
One node can fall into multiple categories. For example, a node can have the
_extension_ `md`, and also be a _file_. In that case, the properties from
the more specific category i.e. _extension_ will be used.
> **NEED HELP:** Auto generate rest of the docs from [src/init.lua][1]
> using [docs/script/generate.py][2].
This can be configured using the `xplr.config.node_types` Lua API.
[1]: https://github.com/sayanarijit/xplr/blob/main/src/init.lua
[2]: https://github.com/sayanarijit/xplr/blob/main/docs/script/generate.py
#### xplr.config.node_types.directory.style
The style for the directory nodes
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.node_types.directory.meta.icon
Metadata for the directory nodes
Type: nullable string
#### xplr.config.node_types.file.style
The style for the file nodes
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.node_types.file.meta.icon
Metadata for the file nodes
Type: nullable string
#### xplr.config.node_types.symlink.style
The style for the symlink nodes
Type: [Style](https://xplr.dev/en/style)
#### xplr.config.node_types.symlink.meta.icon
Metadata for the symlink nodes
Type: nullable string
Metadata and style based on mime types.
It is possible to use the wildcard `*` to match all mime sub types. It will
be overwritten by the more specific sub types that are defined.
Type: mapping of the following key-value pairs:
- key: string
- value:
- key: string
- value: [Node Type](https://xplr.dev/en/node-type)
Example:
```lua
xplr.config.node_types.mime_essence = {
application = {
-- application/*
["*"] = { meta = { icon = "a" } }
-- application/pdf
pdf = { meta = { icon = "" }, style = { fg = "Blue" } },
-- application/zip
zip = { meta = { icon = ""} },
},
}
```
#### xplr.config.node_types.extension
Metadata and style based on extension.
Type: mapping of the following key-value pairs:
- key: string
- value: [Node Type](https://xplr.dev/en/node-type)
Example:
```lua
xplr.config.node_types.extension.md = { meta = { icon = "" }, style = { fg = "Blue" } }
xplr.config.node_types.extension.rs = { meta = { icon = "🦀" } }
```
#### xplr.config.node_types.special
Metadata and style based on special file names.
Type: mapping of the following key-value pairs:
- key: string
- value: [Node Type](https://xplr.dev/en/node-type)
Example:
```lua
xplr.config.node_types.special["Cargo.toml"] = { meta = { icon = "" } }
xplr.config.node_types.special["Downloads"] = { meta = { icon = "" }, style = { fg = "Blue" } }
```

@ -1,7 +1,13 @@
from dataclasses import dataclass
"""Generate docs from comments."""
from dataclasses import dataclass, field
from typing import List
from enum import Enum
TEMPLATE = """
# Messages --------------------------------------------------------------------
MESSAGES_DOC_TEMPLATE = """
# Full List of Messages
xplr messages categorized based on their purpose.
@ -17,26 +23,35 @@ xplr messages categorized based on their purpose.
- [Message](message.md)
""".strip()
CONFIGURATION_DOC_TEMPLATE = """
# Configuration
{doc}
""".strip()
@dataclass
class Section:
class MsgSection:
title: str
body: list
body: List[str]
@dataclass
class Category:
class MsgCategory:
title: str
sections: list
sections: List[MsgSection]
@dataclass
class Result:
categories: list
msgs: list
class MsgResult:
categories: List[MsgCategory]
msgs: List[str]
def gen_messages():
"""Generate messages.md"""
path = "./src/msg/in_/external.rs"
res = []
reading = False
@ -59,8 +74,8 @@ def gen_messages():
if line.startswith("/// ### "):
line = line.lstrip("/// ### ").rstrip("-").strip()
sec = Section(title=None, body=[])
cat = Category(title=line, sections=[sec])
sec = MsgSection(title=None, body=[])
cat = MsgCategory(title=line, sections=[sec])
res.append(cat)
continue
@ -77,11 +92,11 @@ def gen_messages():
line = line.split(",")[0].split("(")[0]
res[-1].sections[-1].title = line
sec = Section(title=None, body=[])
sec = MsgSection(title=None, body=[])
res[-1].sections.append(sec)
continue
result = Result(categories=[], msgs=[])
result = MsgResult(categories=[], msgs=[])
for cat in res:
slug = cat.title.lower().replace(" ", "-")
@ -99,19 +114,112 @@ def gen_messages():
result.msgs.append(f"{line}")
result.msgs.append("")
return result
def main():
res = gen_messages()
doc = TEMPLATE.format(
categories="\n".join(res.categories), msgs="\n".join(res.msgs)
messages = MESSAGES_DOC_TEMPLATE.format(
categories="\n".join(result.categories), msgs="\n".join(result.msgs)
)
print(doc)
print(messages)
with open("./docs/en/src/messages.md", "w") as f:
print(messages, file=f)
# Configuration ---------------------------------------------------------------
def gen_configuration():
"""Generate the following docs.
- configuration.md
- general-config.md
- node_types.md
- layouts.md
- modes.md
"""
path = "./src/init.lua"
configuration = [[]]
general = [[]]
node_types = [[]]
layouts = [[]]
modes = [[]]
with open(path) as f:
lines = iter(f.read().splitlines())
reading = None
for line in lines:
if line.startswith("---"):
continue
if (
line.startswith("-- # Configuration ")
or line.startswith("-- ## Config ")
or line.startswith("-- ## Function ")
):
reading = configuration
if line.startswith("-- ### General Configuration "):
reading = general
if line.startswith("-- ### Node Types "):
reading = node_types
if line.startswith("-- ### Layouts "):
reading = layouts
if line.startswith("-- ### Modes "):
reading = modes
if not reading:
continue
if line.startswith("-- ") or line == "--":
if line.startswith("-- #") and line.endswith("--"):
line = "\n{0}\n".format(line.rstrip("-"))
reading[-1].append(line[3:])
continue
if line.startswith("xplr.") and reading[-1]:
reading[-1].insert(0, "\n#### {0}\n".format(line.split()[0]))
continue
if not line.strip() and reading[-1]:
reading.append([])
continue
with open("./docs/en/src/configuration.md", "w") as f:
doc = "\n".join(["\n".join(c) for c in configuration])
print(doc)
print(doc, file=f)
with open("./docs/en/src/general-config.md", "w") as f:
doc = "\n".join(["\n".join(c) for c in general])
print(doc)
print(doc, file=f)
with open("./docs/en/src/node_types.md", "w") as f:
doc = "\n".join(["\n".join(c) for c in node_types])
print(doc)
print(doc, file=f)
with open("./docs/en/src/layouts.md", "w") as f:
doc = "\n".join(["\n".join(c) for c in layouts])
print(doc)
print(doc, file=f)
with open("./docs/en/src/modes.md", "w") as f:
doc = "\n".join(["\n".join(c) for c in modes])
print(doc)
print(doc, file=f)
def main():
gen_messages()
gen_configuration()
if __name__ == "__main__":
main()

@ -45,6 +45,13 @@ local xplr = xplr -- The globally exposed configuration to be overridden.
--
-- The xplr configuration, exposed via `xplr.config` Lua API contains the
-- following sections.
--
-- See:
--
-- * [xplr.config.general](https://xplr.dev/en/general-config)
-- * [xplr.config.node_types](https://xplr.dev/en/node_types)
-- * [xplr.config.layouts](https://xplr.dev/en/layouts)
-- * [xplr.config.modes](https://xplr.dev/en/modes)
-- ### General Configuration --------------------------------------------------
--
@ -101,10 +108,7 @@ xplr.config.general.prompt.format = " "
-- This is the style of the prompt for the input buffer.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.prompt.style.add_modifiers = nil
xplr.config.general.prompt.style.sub_modifiers = nil
xplr.config.general.prompt.style.bg = nil
xplr.config.general.prompt.style.fg = nil
xplr.config.general.prompt.style = {}
-- The string to indicate an information in logs.
--
@ -114,10 +118,7 @@ xplr.config.general.logs.info.format = "INFO"
-- The style for the informations logs.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.logs.info.style.add_modifiers = nil
xplr.config.general.logs.info.style.sub_modifiers = nil
xplr.config.general.logs.info.style.bg = nil
xplr.config.general.logs.info.style.fg = "LightBlue"
xplr.config.general.logs.info.style = { fg = "LightBlue" }
-- The string to indicate an success in logs.
--
@ -127,10 +128,7 @@ xplr.config.general.logs.success.format = "SUCCESS"
-- The style for the success logs.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.logs.success.style.add_modifiers = nil
xplr.config.general.logs.success.style.bg = nil
xplr.config.general.logs.success.style.fg = "Green"
xplr.config.general.logs.success.style.sub_modifiers = nil
xplr.config.general.logs.success.style = { fg = "Green" }
-- The string to indicate an warnings in logs.
--
@ -140,10 +138,7 @@ xplr.config.general.logs.warning.format = "WARNING"
-- The style for the warnings logs.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.logs.warning.style.add_modifiers = nil
xplr.config.general.logs.warning.style.bg = nil
xplr.config.general.logs.warning.style.fg = "Yellow"
xplr.config.general.logs.warning.style.sub_modifiers = nil
xplr.config.general.logs.warning.style = { fg = "Yellow" }
-- The string to indicate an error in logs.
--
@ -153,47 +148,26 @@ xplr.config.general.logs.error.format = "ERROR"
-- The style for the error logs.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.logs.error.style.add_modifiers = nil
xplr.config.general.logs.error.style.sub_modifiers = nil
xplr.config.general.logs.error.style.bg = nil
xplr.config.general.logs.error.style.fg = "Red"
xplr.config.general.logs.error.style = { fg = "Red" }
-- Columns to display in the table header.
--
-- Type: nullable list of tables with the following fields:
--
-- * format: nullable string
-- * style: [Style][https://xplr.dev/en/style]
-- * style: [Style](https://xplr.dev/en/style)
xplr.config.general.table.header.cols = {
{
format = " index",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
{
format = "╭──── path",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
{
format = "permissions",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
{
format = "size",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
{
format = "type",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
{ format = " index", style = {} },
{ format = "╭──── path", style = {} },
{ format = "permissions", style = {} },
{ format = "size", style = {} },
{ format = "type", style = {} },
}
-- Style of the table header.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.table.header.style.add_modifiers = { "Bold" }
xplr.config.general.table.header.style.sub_modifiers = nil
xplr.config.general.table.header.style.bg = nil
xplr.config.general.table.header.style.fg = nil
xplr.config.general.table.header.style = { add_modifiers = { "Bold" } }
-- Height of the table header.
--
@ -209,33 +183,30 @@ xplr.config.general.table.header.height = 1
xplr.config.general.table.row.cols = {
{
format = "builtin.fmt_general_table_row_cols_0",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
style = {},
},
{
format = "builtin.fmt_general_table_row_cols_1",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
style = {},
},
{
format = "builtin.fmt_general_table_row_cols_2",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
style = {},
},
{
format = "builtin.fmt_general_table_row_cols_3",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
style = {},
},
{
format = "builtin.fmt_general_table_row_cols_4",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
style = {},
},
}
-- Default style of the table.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.table.row.style.add_modifiers = nil
xplr.config.general.table.row.style.bg = nil
xplr.config.general.table.row.style.fg = nil
xplr.config.general.table.row.style.sub_modifiers = nil
xplr.config.general.table.row.style = {}
-- Height of the table rows.
--
@ -245,10 +216,7 @@ xplr.config.general.table.row.height = 0
-- Default style of the table.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.table.style.add_modifiers = nil
xplr.config.general.table.style.bg = nil
xplr.config.general.table.style.fg = nil
xplr.config.general.table.style.sub_modifiers = nil
xplr.config.general.table.style = {}
-- Tree to display in the table.
--
@ -257,18 +225,9 @@ xplr.config.general.table.style.sub_modifiers = nil
-- * format: nullable string
-- * style: [Style](https://xplr.dev/en/style)
xplr.config.general.table.tree = {
{
format = "├─",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
{
format = "├─",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
{
format = "╰─",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
{ format = "├─", style = {} },
{ format = "├─", style = {} },
{ format = "╰─", style = {} },
}
-- Spacing between the columns in the table.
@ -300,10 +259,7 @@ xplr.config.general.default_ui.suffix = ""
-- The default style of each item for each row.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.default_ui.style.add_modifiers = nil
xplr.config.general.default_ui.style.sub_modifiers = nil
xplr.config.general.default_ui.style.bg = nil
xplr.config.general.default_ui.style.fg = nil
xplr.config.general.default_ui.style = {}
-- The string placed before the item name for a focused row.
--
@ -317,10 +273,7 @@ xplr.config.general.focus_ui.suffix = "]"
-- Style for focused item.
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.focus_ui.style.add_modifiers = { "Bold" }
xplr.config.general.focus_ui.style.sub_modifiers = nil
xplr.config.general.focus_ui.style.bg = nil
xplr.config.general.focus_ui.style.fg = "Blue"
xplr.config.general.focus_ui.style = { add_modifiers = { "Bold" } }
-- The string placed before the item name for a selected row.
--
@ -335,10 +288,10 @@ xplr.config.general.selection_ui.suffix = "}"
-- Style for selected rows.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.selection_ui.style.add_modifiers = { "Bold" }
xplr.config.general.selection_ui.style.sub_modifiers = nil
xplr.config.general.selection_ui.style.bg = nil
xplr.config.general.selection_ui.style.fg = "LightGreen"
xplr.config.general.selection_ui.style = {
fg = "LightGreen",
add_modifiers = { "Bold" },
}
-- The string placed before item name for a selected row that gets the focus.
--
@ -353,10 +306,10 @@ xplr.config.general.focus_selection_ui.suffix = "]"
-- Style for a selected row that gets the focus.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.focus_selection_ui.style.add_modifiers = { "Bold" }
xplr.config.general.focus_selection_ui.style.sub_modifiers = nil
xplr.config.general.focus_selection_ui.style.bg = nil
xplr.config.general.focus_selection_ui.style.fg = "LightGreen"
xplr.config.general.focus_selection_ui.style = {
fg = "LightGreen",
add_modifiers = { "Bold" },
}
-- The shape of the separator for the Sort & filter panel.
--
@ -366,10 +319,9 @@ xplr.config.general.sort_and_filter_ui.separator.format = " "
-- The style of the separator for the Sort & filter panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.sort_and_filter_ui.separator.style.add_modifiers = { "Dim" }
xplr.config.general.sort_and_filter_ui.separator.style.bg = nil
xplr.config.general.sort_and_filter_ui.separator.style.fg = nil
xplr.config.general.sort_and_filter_ui.separator.style.sub_modifiers = nil
xplr.config.general.sort_and_filter_ui.separator.style = {
add_modifiers = { "Dim" },
}
-- The content of the default identifier in Sort & filter panel.
--
@ -379,14 +331,9 @@ xplr.config.general.sort_and_filter_ui.default_identifier.format = nil
-- Style for the default identifier in Sort & filter panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.sort_and_filter_ui.default_identifier.style.add_modifiers =
{
"Bold",
}
xplr.config.general.sort_and_filter_ui.default_identifier.style.bg = nil
xplr.config.general.sort_and_filter_ui.default_identifier.style.fg = nil
xplr.config.general.sort_and_filter_ui.default_identifier.style.sub_modifiers =
nil
xplr.config.general.sort_and_filter_ui.default_identifier.style = {
add_modifiers = { "Bold" },
}
-- The shape of the forward direction indicator for sort identifiers in Sort & filter panel.
--
@ -397,13 +344,7 @@ xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.forward.format
-- Style of forward direction indicator in Sort & filter panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.forward.style.add_modifiers =
nil
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.forward.style.bg =
nil
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.forward.style.fg =
nil
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.forward.style.sub_modifiers =
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.forward.style =
nil
-- The shape of the reverse direction indicator for sort identifiers in Sort & filter panel.
@ -415,13 +356,7 @@ xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.format
-- Style of reverse direction indicator in Sort & filter panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.style.add_modifiers =
nil
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.style.bg =
nil
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.style.fg =
nil
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.style.sub_modifiers =
xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.style =
nil
-- The identifiers used to denote applied sorters in the Sort & filter panel.
@ -431,112 +366,34 @@ xplr.config.general.sort_and_filter_ui.sort_direction_identifiers.reverse.style.
-- * key: [Sorter](https://xplr.dev/en/sorting#sorter)
-- * value:
-- * format: nullable string
-- * style: [Style][https://xplr.dev/en/style]
-- * style: [Style](https://xplr.dev/en/style)
xplr.config.general.sort_and_filter_ui.sorter_identifiers = {
ByCanonicalAbsolutePath = {
format = "[c]abs",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByCanonicalExtension = {
format = "[c]ext",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByCanonicalIsDir = {
format = "[c]dir",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByCanonicalIsFile = {
format = "[c]file",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByCanonicalIsReadonly = {
format = "[c]ro",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByCanonicalMimeEssence = {
format = "[c]mime",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByCanonicalSize = {
format = "[c]size",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByExtension = {
format = "ext",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByICanonicalAbsolutePath = {
format = "[ci]abs",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByIRelativePath = {
format = "[i]rel",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByISymlinkAbsolutePath = {
format = "[si]abs",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByIsBroken = {
format = "",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByIsDir = {
format = "dir",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByIsFile = {
format = "file",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByIsReadonly = {
format = "ro",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByIsSymlink = {
format = "sym",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByMimeEssence = {
format = "mime",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByRelativePath = {
format = "rel",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
BySize = {
format = "size",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
BySymlinkAbsolutePath = {
format = "[s]abs",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
BySymlinkExtension = {
format = "[s]ext",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
BySymlinkIsDir = {
format = "[s]dir",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
BySymlinkIsFile = {
format = "[s]file",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
BySymlinkIsReadonly = {
format = "[s]ro",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
BySymlinkMimeEssence = {
format = "[s]mime",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
BySymlinkSize = {
format = "[s]size",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
ByCanonicalAbsolutePath = { format = "[c]abs", style = {} },
ByCanonicalExtension = { format = "[c]ext", style = {} },
ByCanonicalIsDir = { format = "[c]dir", style = {} },
ByCanonicalIsFile = { format = "[c]file", style = {} },
ByCanonicalIsReadonly = { format = "[c]ro", style = {} },
ByCanonicalMimeEssence = { format = "[c]mime", style = {} },
ByCanonicalSize = { format = "[c]size", style = {} },
ByExtension = { format = "ext", style = {} },
ByICanonicalAbsolutePath = { format = "[ci]abs", style = {} },
ByIRelativePath = { format = "[i]rel", style = {} },
ByISymlinkAbsolutePath = { format = "[si]abs", style = {} },
ByIsBroken = { format = "", style = {} },
ByIsDir = { format = "dir", style = {} },
ByIsFile = { format = "file", style = {} },
ByIsReadonly = { format = "ro", style = {} },
ByIsSymlink = { format = "sym", style = {} },
ByMimeEssence = { format = "mime", style = {} },
ByRelativePath = { format = "rel", style = {} },
BySize = { format = "size", style = {} },
BySymlinkAbsolutePath = { format = "[s]abs", style = {} },
BySymlinkExtension = { format = "[s]ext", style = {} },
BySymlinkIsDir = { format = "[s]dir", style = {} },
BySymlinkIsFile = { format = "[s]file", style = {} },
BySymlinkIsReadonly = { format = "[s]ro", style = {} },
BySymlinkMimeEssence = { format = "[s]mime", style = {} },
BySymlinkSize = { format = "[s]size", style = {} },
}
-- The identifiers used to denote applied filters in the Sort & filter panel.
@ -546,136 +403,40 @@ xplr.config.general.sort_and_filter_ui.sorter_identifiers = {
-- * key: [Filter](https://xplr.dev/en/filtering#filter)
-- * value:
-- * format: nullable string
-- * style: [Style][https://xplr.dev/en/style]
-- * style: [Style](https://xplr.dev/en/style)
xplr.config.general.sort_and_filter_ui.filter_identifiers = {
AbsolutePathDoesContain = {
format = "abs=~",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
AbsolutePathDoesEndWith = {
format = "abs=$",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
AbsolutePathDoesNotContain = {
format = "abs!~",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
AbsolutePathDoesNotEndWith = {
format = "abs!$",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
AbsolutePathDoesNotStartWith = {
format = "abs!^",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
AbsolutePathDoesStartWith = {
format = "abs=^",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
AbsolutePathIs = {
format = "abs==",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
AbsolutePathIsNot = {
format = "abs!=",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IAbsolutePathDoesContain = {
format = "[i]abs=~",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IAbsolutePathDoesEndWith = {
format = "[i]abs=$",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IAbsolutePathDoesNotContain = {
format = "[i]abs!~",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IAbsolutePathDoesNotEndWith = {
format = "[i]abs!$",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IAbsolutePathDoesNotStartWith = {
format = "[i]abs!^",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IAbsolutePathDoesStartWith = {
format = "[i]abs=^",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IAbsolutePathIs = {
format = "[i]abs==",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IAbsolutePathIsNot = {
format = "[i]abs!=",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IRelativePathDoesContain = {
format = "[i]rel=~",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IRelativePathDoesEndWith = {
format = "[i]rel=$",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IRelativePathDoesNotContain = {
format = "[i]rel!~",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IRelativePathDoesNotEndWith = {
format = "[i]rel!$",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IRelativePathDoesNotStartWith = {
format = "[i]rel!^",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IRelativePathDoesStartWith = {
format = "[i]rel=^",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IRelativePathIs = {
format = "[i]rel==",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
IRelativePathIsNot = {
format = "[i]rel!=",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
RelativePathDoesContain = {
format = "rel=~",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
RelativePathDoesEndWith = {
format = "rel=$",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
RelativePathDoesNotContain = {
format = "rel!~",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
RelativePathDoesNotEndWith = {
format = "rel!$",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
RelativePathDoesNotStartWith = {
format = "rel!^",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
RelativePathDoesStartWith = {
format = "rel=^",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
RelativePathIs = {
format = "rel==",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
RelativePathIsNot = {
format = "rel!=",
style = { add_modifiers = nil, bg = nil, fg = nil, sub_modifiers = nil },
},
AbsolutePathDoesContain = { format = "abs=~", style = {} },
AbsolutePathDoesEndWith = { format = "abs=$", style = {} },
AbsolutePathDoesNotContain = { format = "abs!~", style = {} },
AbsolutePathDoesNotEndWith = { format = "abs!$", style = {} },
AbsolutePathDoesNotStartWith = { format = "abs!^", style = {} },
AbsolutePathDoesStartWith = { format = "abs=^", style = {} },
AbsolutePathIs = { format = "abs==", style = {} },
AbsolutePathIsNot = { format = "abs!=", style = {} },
IAbsolutePathDoesContain = { format = "[i]abs=~", style = {} },
IAbsolutePathDoesEndWith = { format = "[i]abs=$", style = {} },
IAbsolutePathDoesNotContain = { format = "[i]abs!~", style = {} },
IAbsolutePathDoesNotEndWith = { format = "[i]abs!$", style = {} },
IAbsolutePathDoesNotStartWith = { format = "[i]abs!^", style = {} },
IAbsolutePathDoesStartWith = { format = "[i]abs=^", style = {} },
IAbsolutePathIs = { format = "[i]abs==", style = {} },
IAbsolutePathIsNot = { format = "[i]abs!=", style = {} },
IRelativePathDoesContain = { format = "[i]rel=~", style = {} },
IRelativePathDoesEndWith = { format = "[i]rel=$", style = {} },
IRelativePathDoesNotContain = { format = "[i]rel!~", style = {} },
IRelativePathDoesNotEndWith = { format = "[i]rel!$", style = {} },
IRelativePathDoesNotStartWith = { format = "[i]rel!^", style = {} },
IRelativePathDoesStartWith = { format = "[i]rel=^", style = {} },
IRelativePathIs = { format = "[i]rel==", style = {} },
IRelativePathIsNot = { format = "[i]rel!=", style = {} },
RelativePathDoesContain = { format = "rel=~", style = {} },
RelativePathDoesEndWith = { format = "rel=$", style = {} },
RelativePathDoesNotContain = { format = "rel!~", style = {} },
RelativePathDoesNotEndWith = { format = "rel!$", style = {} },
RelativePathDoesNotStartWith = { format = "rel!^", style = {} },
RelativePathDoesStartWith = { format = "rel=^", style = {} },
RelativePathIs = { format = "rel==", style = {} },
RelativePathIsNot = { format = "rel!=", style = {} },
}
-- The content for panel title by default.
@ -686,18 +447,12 @@ xplr.config.general.panel_ui.default.title.format = nil
-- The style for panel title by default.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.default.title.style.add_modifiers = nil
xplr.config.general.panel_ui.default.title.style.bg = nil
xplr.config.general.panel_ui.default.title.style.fg = nil
xplr.config.general.panel_ui.default.title.style.sub_modifiers = nil
xplr.config.general.panel_ui.default.title.style = {}
-- Style of the panels by default.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.default.style.add_modifiers = nil
xplr.config.general.panel_ui.default.style.bg = nil
xplr.config.general.panel_ui.default.style.fg = nil
xplr.config.general.panel_ui.default.style.sub_modifiers = nil
xplr.config.general.panel_ui.default.style = {}
-- Defines where to show borders for the panels by default.
--
@ -717,10 +472,7 @@ xplr.config.general.panel_ui.default.border_type = nil
-- Style of the panel borders by default.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.default.border_style.fg = nil
xplr.config.general.panel_ui.default.border_style.bg = nil
xplr.config.general.panel_ui.default.border_style.add_modifiers = nil
xplr.config.general.panel_ui.default.border_style.sub_modifiers = nil
xplr.config.general.panel_ui.default.border_style = {}
-- The content for the table panel title.
--
@ -730,18 +482,12 @@ xplr.config.general.panel_ui.table.title.format = nil
-- Style of the table panel title.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.table.title.style.add_modifiers = nil
xplr.config.general.panel_ui.table.title.style.bg = nil
xplr.config.general.panel_ui.table.title.style.fg = nil
xplr.config.general.panel_ui.table.title.style.sub_modifiers = nil
xplr.config.general.panel_ui.table.title.style = {}
-- Style of the table panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.table.style.add_modifiers = nil
xplr.config.general.panel_ui.table.style.bg = nil
xplr.config.general.panel_ui.table.style.fg = nil
xplr.config.general.panel_ui.table.style.sub_modifiers = nil
xplr.config.general.panel_ui.table.style = {}
-- Defines where to show borders for the table panel.
--
@ -756,10 +502,7 @@ xplr.config.general.panel_ui.table.border_type = nil
-- Style of the table panel borders.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.table.border_style.fg = nil
xplr.config.general.panel_ui.table.border_style.bg = nil
xplr.config.general.panel_ui.table.border_style.add_modifiers = nil
xplr.config.general.panel_ui.table.border_style.sub_modifiers = nil
xplr.config.general.panel_ui.table.border_style = {}
-- The content for the help menu panel title.
--
@ -769,18 +512,12 @@ xplr.config.general.panel_ui.help_menu.title.format = nil
-- Style of the help menu panel title.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.help_menu.title.style.add_modifiers = nil
xplr.config.general.panel_ui.help_menu.title.style.bg = nil
xplr.config.general.panel_ui.help_menu.title.style.fg = nil
xplr.config.general.panel_ui.help_menu.title.style.sub_modifiers = nil
xplr.config.general.panel_ui.help_menu.title.style = {}
-- Style of the help menu panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.help_menu.style.add_modifiers = nil
xplr.config.general.panel_ui.help_menu.style.bg = nil
xplr.config.general.panel_ui.help_menu.style.fg = nil
xplr.config.general.panel_ui.help_menu.style.sub_modifiers = nil
xplr.config.general.panel_ui.help_menu.style = {}
-- Defines where to show borders for the help menu panel.
--
@ -795,10 +532,7 @@ xplr.config.general.panel_ui.help_menu.border_type = nil
-- Style of the help menu panel borders.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.help_menu.border_style.fg = nil
xplr.config.general.panel_ui.help_menu.border_style.bg = nil
xplr.config.general.panel_ui.help_menu.border_style.add_modifiers = nil
xplr.config.general.panel_ui.help_menu.border_style.sub_modifiers = nil
xplr.config.general.panel_ui.help_menu.border_style = {}
-- The content for the input & logs panel title.
--
@ -808,18 +542,12 @@ xplr.config.general.panel_ui.input_and_logs.title.format = nil
-- Style of the input & logs panel title.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.input_and_logs.title.style.add_modifiers = nil
xplr.config.general.panel_ui.input_and_logs.title.style.bg = nil
xplr.config.general.panel_ui.input_and_logs.title.style.fg = nil
xplr.config.general.panel_ui.input_and_logs.title.style.sub_modifiers = nil
xplr.config.general.panel_ui.input_and_logs.title.style = {}
-- Style of the input & logs panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.input_and_logs.style.add_modifiers = nil
xplr.config.general.panel_ui.input_and_logs.style.bg = nil
xplr.config.general.panel_ui.input_and_logs.style.fg = nil
xplr.config.general.panel_ui.input_and_logs.style.sub_modifiers = nil
xplr.config.general.panel_ui.input_and_logs.style = {}
-- Defines where to show borders for the input & logs panel.
--
-- Type: nullable list of [Border](https://xplr.dev/en/borders#border)
@ -833,10 +561,7 @@ xplr.config.general.panel_ui.input_and_logs.border_type = nil
-- Style of the input & logs panel borders.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.input_and_logs.border_style.fg = nil
xplr.config.general.panel_ui.input_and_logs.border_style.bg = nil
xplr.config.general.panel_ui.input_and_logs.border_style.add_modifiers = nil
xplr.config.general.panel_ui.input_and_logs.border_style.sub_modifiers = nil
xplr.config.general.panel_ui.input_and_logs.border_style = {}
-- The content for the selection panel title.
--
@ -846,18 +571,12 @@ xplr.config.general.panel_ui.selection.title.format = nil
-- Style of the selection panel title.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.selection.title.style.add_modifiers = nil
xplr.config.general.panel_ui.selection.title.style.bg = nil
xplr.config.general.panel_ui.selection.title.style.fg = nil
xplr.config.general.panel_ui.selection.title.style.sub_modifiers = nil
xplr.config.general.panel_ui.selection.title.style = {}
-- Style of the selection panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.selection.style.add_modifiers = nil
xplr.config.general.panel_ui.selection.style.bg = nil
xplr.config.general.panel_ui.selection.style.fg = nil
xplr.config.general.panel_ui.selection.style.sub_modifiers = nil
xplr.config.general.panel_ui.selection.style = {}
-- Defines where to show borders for the selection panel.
--
-- Type: nullable list of [Border](https://xplr.dev/en/borders#border)
@ -871,10 +590,7 @@ xplr.config.general.panel_ui.selection.border_type = nil
-- Style of the selection panel borders.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.selection.border_style.fg = nil
xplr.config.general.panel_ui.selection.border_style.bg = nil
xplr.config.general.panel_ui.selection.border_style.add_modifiers = nil
xplr.config.general.panel_ui.selection.border_style.sub_modifiers = nil
xplr.config.general.panel_ui.selection.border_style = {}
-- The content for the sort & filter panel title.
--
@ -884,18 +600,12 @@ xplr.config.general.panel_ui.sort_and_filter.title.format = nil
-- Style of the sort & filter panel title.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.sort_and_filter.title.style.add_modifiers = nil
xplr.config.general.panel_ui.sort_and_filter.title.style.bg = nil
xplr.config.general.panel_ui.sort_and_filter.title.style.fg = nil
xplr.config.general.panel_ui.sort_and_filter.title.style.sub_modifiers = nil
xplr.config.general.panel_ui.sort_and_filter.title.style = {}
-- Style of the sort & filter panel.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.sort_and_filter.style.add_modifiers = nil
xplr.config.general.panel_ui.sort_and_filter.style.bg = nil
xplr.config.general.panel_ui.sort_and_filter.style.fg = nil
xplr.config.general.panel_ui.sort_and_filter.style.sub_modifiers = nil
xplr.config.general.panel_ui.sort_and_filter.style = {}
-- Defines where to show borders for the sort & filter panel.
--
@ -910,10 +620,7 @@ xplr.config.general.panel_ui.sort_and_filter.border_type = nil
-- Style of the sort & filter panel borders.
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.general.panel_ui.sort_and_filter.border_style.fg = nil
xplr.config.general.panel_ui.sort_and_filter.border_style.bg = nil
xplr.config.general.panel_ui.sort_and_filter.border_style.add_modifiers = nil
xplr.config.general.panel_ui.sort_and_filter.border_style.sub_modifiers = nil
xplr.config.general.panel_ui.sort_and_filter.border_style = {}
-- Initial group if sorters applied to the nodes list in the table.
--
@ -953,10 +660,10 @@ xplr.config.general.start_fifo = nil
-- The style for the directory nodes
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.node_types.directory.style.add_modifiers = { "Bold" }
xplr.config.node_types.directory.style.sub_modifiers = nil
xplr.config.node_types.directory.style.bg = nil
xplr.config.node_types.directory.style.fg = "Cyan"
xplr.config.node_types.directory.style = {
fg = "Cyan",
add_modifiers = { "Bold" },
}
-- Metadata for the directory nodes
--
@ -966,10 +673,7 @@ xplr.config.node_types.directory.meta.icon = "ð"
-- The style for the file nodes
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.node_types.file.style.add_modifiers = nil
xplr.config.node_types.file.style.sub_modifiers = nil
xplr.config.node_types.file.style.bg = nil
xplr.config.node_types.file.style.fg = nil
xplr.config.node_types.file.style = {}
-- Metadata for the file nodes
--
@ -979,10 +683,10 @@ xplr.config.node_types.file.meta.icon = "ƒ"
-- The style for the symlink nodes
--
-- Type: [Style](https://xplr.dev/en/style)
xplr.config.node_types.symlink.style.add_modifiers = { "Italic" }
xplr.config.node_types.symlink.style.sub_modifiers = nil
xplr.config.node_types.symlink.style.bg = nil
xplr.config.node_types.symlink.style.fg = "Magenta"
xplr.config.node_types.symlink.style = {
fg = "Magenta",
add_modifiers = { "Italic" },
}
-- Metadata for the symlink nodes
--
@ -1016,6 +720,7 @@ xplr.config.node_types.symlink.meta.icon = "§"
-- },
-- }
-- ```
xplr.config.node_types.mime_essence = {}
-- Metadata and style based on extension.
@ -2615,8 +2320,12 @@ xplr.config.modes.builtin.sort = {
["n"] = {
help = "by node type",
messages = {
{ AddNodeSorter = { sorter = "ByCanonicalIsDir", reverse = false } },
{ AddNodeSorter = { sorter = "ByCanonicalIsFile", reverse = false } },
{
AddNodeSorter = { sorter = "ByCanonicalIsDir", reverse = false },
},
{
AddNodeSorter = { sorter = "ByCanonicalIsFile", reverse = false },
},
{
AddNodeSorter = { sorter = "ByIsSymlink", reverse = false },
},
@ -2728,9 +2437,15 @@ xplr.config.modes.custom = {}
--
-- While `xplr.config` defines all the static parts of the configuration,
-- `xplr.fn` defines all the dynamic parts using functions.
--
-- See: [Lua Function Calls](https://xplr.dev/en/lua-function-calls)
-- ### Builtin Functions ------------------------------------------------------
--
-- As always, `xplr.fn.builtin` is where the built-in functions are defined
-- that can be overwritten.
-- Renders the first column in the table
xplr.fn.builtin.fmt_general_table_row_cols_0 = function(m)
local r = ""
if m.is_before_focus then
@ -2744,6 +2459,7 @@ xplr.fn.builtin.fmt_general_table_row_cols_0 = function(m)
return r
end
-- Renders the second column in the table
xplr.fn.builtin.fmt_general_table_row_cols_1 = function(m)
local r = m.tree .. m.prefix
@ -2778,6 +2494,7 @@ xplr.fn.builtin.fmt_general_table_row_cols_1 = function(m)
return r
end
-- Renders the third column in the table
xplr.fn.builtin.fmt_general_table_row_cols_2 = function(m)
local no_color = os.getenv("NO_COLOR")
@ -2859,6 +2576,7 @@ xplr.fn.builtin.fmt_general_table_row_cols_2 = function(m)
return r
end
-- Renders the fourth column in the table
xplr.fn.builtin.fmt_general_table_row_cols_3 = function(m)
if not m.is_dir then
return m.human_size
@ -2867,6 +2585,7 @@ xplr.fn.builtin.fmt_general_table_row_cols_3 = function(m)
end
end
-- Renders the fifth column in the table
xplr.fn.builtin.fmt_general_table_row_cols_4 = function(m)
if m.is_symlink and not m.is_broken then
return m.symlink.mime_essence
@ -2875,6 +2594,8 @@ xplr.fn.builtin.fmt_general_table_row_cols_4 = function(m)
end
end
-- ### Custom Functions -------------------------------------------------------
--
-- This is where the custom functions can be added.
--
-- There is currently no restriction on what kind of functions can be defined
@ -2882,4 +2603,5 @@ end
--
-- You can also use nested tables such as
-- `xplr.fn.custom.my_plugin.my_function` to define custom functions.
xplr.fn.custom = {}

Loading…
Cancel
Save