2021-06-22 11:52:46 +00:00
|
|
|
Configuration
|
|
|
|
=============
|
|
|
|
|
2021-07-03 09:24:37 +00:00
|
|
|
xplr can be configured using [Lua][1] via a special file
|
2021-06-22 11:52:46 +00:00
|
|
|
named `init.lua`
|
2021-07-03 09:24:37 +00:00
|
|
|
([example][2]), which
|
2021-06-22 11:52:46 +00:00
|
|
|
can be placed in `~/.config/xplr/` (user specific) or `/etc/xplr/` (global)
|
|
|
|
depending on the use case.
|
|
|
|
|
|
|
|
When a user specific configuration is available, the global configuration file
|
|
|
|
will be ignored.
|
|
|
|
|
|
|
|
However, it's also possible to place the file anywhere, with any name and use
|
|
|
|
the command-line argument `-c` / `--config` to specify its path explicitely. In
|
|
|
|
that case, both `~/.config/xplr/init.lua` and `/etc/xplr/init.lua` will be
|
|
|
|
ignored.
|
|
|
|
|
|
|
|
|
2021-06-24 03:33:28 +00:00
|
|
|
How Config Is Loaded
|
2021-06-23 11:31:11 +00:00
|
|
|
--------------------
|
2021-06-22 11:52:46 +00:00
|
|
|
|
|
|
|
When xplr loads, it first executes the built-in
|
2021-07-03 09:24:37 +00:00
|
|
|
[init.lua][2] to set
|
2021-06-23 11:31:11 +00:00
|
|
|
the default values, which is then overwritten by another config file, if found
|
2021-06-22 11:52:46 +00:00
|
|
|
using the following lookup order:
|
|
|
|
|
|
|
|
**--config /path/to/init.lua** > **~/.config/xplr/init.lua** > **/etc/xplr/init.lua**
|
2021-06-24 03:33:28 +00:00
|
|
|
|
|
|
|
|
2021-06-24 16:17:01 +00:00
|
|
|
config
|
|
|
|
------
|
|
|
|
|
|
|
|
The xplr configuration, exposed as `xplr.config` Lua API contains the
|
|
|
|
following fields:
|
|
|
|
|
2021-07-03 09:24:37 +00:00
|
|
|
- [general][3]
|
|
|
|
- [modes][4]
|
|
|
|
- [layouts][5]
|
|
|
|
- [node_types][6]
|
|
|
|
|
|
|
|
|
|
|
|
[1]:https://www.lua.org/
|
|
|
|
[2]:https://github.com/sayanarijit/xplr/blob/main/src/init.lua
|
|
|
|
[3]:general-config.md
|
|
|
|
[4]:modes.md
|
|
|
|
[5]:layouts.md
|
|
|
|
[6]:node_types.md
|