fish_config: Add CLI-based theme selector

`fish_config theme`:

- `list` to list all available themes (files in the two theme
directories - either the web_config/themes one or
~/.config/fish/themes!)
- `show` to show select (or all) themes right in the terminal - this
starts another fish that reads the theme file and prints the sample
text, manually colored
- `choose` to load a theme *now*, setting the variables globally
- `save` to load a theme and save the variables universally
- `dump` to write the current theme in .theme format (to stdout)
- `demo` to display the current theme
This commit is contained in:
Fabian Homborg
2021-07-10 10:26:58 +02:00
parent fd35dc2aa1
commit 8223e6f23e
3 changed files with 224 additions and 69 deletions

View File

@@ -11,6 +11,7 @@ Synopsis
fish_config
fish_config browse
fish_config prompt (choose | list | save | show)
fish_config theme (choose | demo | dump | list | save | show)
Description
-----------
@@ -30,6 +31,19 @@ Available subcommands for the ``prompt`` command:
- ``save`` saves the current prompt to a file (via :ref:`funcsave <cmd-funcsave>`).
- ``show`` shows what the given sample prompts (or all) would look like.
With the ``theme`` command ``fish_config`` can be used to view and choose a theme (meaning a color scheme) inside the terminal.
Available subcommands for the ``theme`` command:
- ``choose`` loads a sample theme in the current session.
- ``demo`` displays some sample text in the current theme.
- ``dump`` prints the current theme in a loadable format.
- ``list`` lists the names of the available sample themes.
- ``save`` saves the current prompt to :ref:`universal variables <variables-universal>`.
- ``show`` shows what the given sample theme (or all) would look like.
The themes are loaded from the theme directory shipped with fish or a ``themes`` directory in the fish configuration directory (typically ``~/.config/fish/themes``).
Example
-------