mirror of https://github.com/sayanarijit/xplr
Auto generate docs
parent
88b79643cb
commit
0472bc3e66
@ -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
|
||||
```
|
||||
|
@ -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" } }
|
||||
```
|
||||
|
Loading…
Reference in New Issue