docs: Make color variables envvar definitions

This allows linking them from elsewhere (currently fish_indent) and
also improves the formatting - the code formatting here isn't actually a good look.
This commit is contained in:
Fabian Boehm
2022-12-28 12:20:50 +01:00
parent 8ee4efe7d8
commit ddcb14c8f8

View File

@@ -99,34 +99,34 @@ Example: to make errors highlighted and red, use::
The following variables are available to change the highlighting colors in fish:
========================================== =====================================================================
Variable Meaning
========================================== =====================================================================
``fish_color_normal`` default color
``fish_color_command`` commands like echo
``fish_color_keyword`` keywords like if - this falls back on the command color if unset
``fish_color_quote`` quoted text like ``"abc"``
``fish_color_redirection`` IO redirections like >/dev/null
``fish_color_end`` process separators like ``;`` and ``&``
``fish_color_error`` syntax errors
``fish_color_param`` ordinary command parameters
``fish_color_valid_path`` parameters that are filenames (if the file exists)
``fish_color_option`` options starting with "-", up to the first "--" parameter
``fish_color_comment`` comments like '# important'
``fish_color_selection`` selected text in vi visual mode
``fish_color_operator`` parameter expansion operators like ``*`` and ``~``
``fish_color_escape`` character escapes like ``\n`` and ``\x70``
``fish_color_autosuggestion`` autosuggestions (the proposed rest of a command)
``fish_color_cwd`` the current working directory in the default prompt
``fish_color_cwd_root`` the current working directory in the default prompt for the root user
``fish_color_user`` the username in the default prompt
``fish_color_host`` the hostname in the default prompt
``fish_color_host_remote`` the hostname in the default prompt for remote sessions (like ssh)
``fish_color_status`` the last command's nonzero exit code in the default prompt
``fish_color_cancel`` the '^C' indicator on a canceled command
``fish_color_search_match`` history search matches and selected pager items (background only)
========================================== =====================================================================
Variable Meaning
========================================== =====================================================================
.. envvar:: fish_color_normal default color
.. envvar:: fish_color_command commands like echo
.. envvar:: fish_color_keyword keywords like if - this falls back on the command color if unset
.. envvar:: fish_color_quote quoted text like ``"abc"``
.. envvar:: fish_color_redirection IO redirections like >/dev/null
.. envvar:: fish_color_end process separators like ``;`` and ``&``
.. envvar:: fish_color_error syntax errors
.. envvar:: fish_color_param ordinary command parameters
.. envvar:: fish_color_valid_path parameters that are filenames (if the file exists)
.. envvar:: fish_color_option options starting with "-", up to the first "--" parameter
.. envvar:: fish_color_comment comments like '# important'
.. envvar:: fish_color_selection selected text in vi visual mode
.. envvar:: fish_color_operator parameter expansion operators like ``*`` and ``~``
.. envvar:: fish_color_escape character escapes like ``\n`` and ``\x70``
.. envvar:: fish_color_autosuggestion autosuggestions (the proposed rest of a command)
.. envvar:: fish_color_cwd the current working directory in the default prompt
.. envvar:: fish_color_cwd_root the current working directory in the default prompt for the root user
.. envvar:: fish_color_user the username in the default prompt
.. envvar:: fish_color_host the hostname in the default prompt
.. envvar:: fish_color_host_remote the hostname in the default prompt for remote sessions (like ssh)
.. envvar:: fish_color_status the last command's nonzero exit code in the default prompt
.. envvar:: fish_color_cancel the '^C' indicator on a canceled command
.. envvar:: fish_color_search_match history search matches and selected pager items (background only)
========================================== =====================================================================
========================================== =====================================================================
If a variable isn't set or is empty, fish usually tries ``$fish_color_normal``, except for:
@@ -156,23 +156,23 @@ To have black text on alternating white and gray backgrounds::
Variables affecting the pager colors:
========================================== ===========================================================
=================================================== ===========================================================
Variable Meaning
========================================== ===========================================================
``fish_pager_color_progress`` the progress bar at the bottom left corner
``fish_pager_color_background`` the background color of a line
``fish_pager_color_prefix`` the prefix string, i.e. the string that is to be completed
``fish_pager_color_completion`` the completion itself, i.e. the proposed rest of the string
``fish_pager_color_description`` the completion description
``fish_pager_color_selected_background`` background of the selected completion
``fish_pager_color_selected_prefix`` prefix of the selected completion
``fish_pager_color_selected_completion`` suffix of the selected completion
``fish_pager_color_selected_description`` description of the selected completion
``fish_pager_color_secondary_background`` background of every second unselected completion
``fish_pager_color_secondary_prefix`` prefix of every second unselected completion
``fish_pager_color_secondary_completion`` suffix of every second unselected completion
``fish_pager_color_secondary_description`` description of every second unselected completion
========================================== ===========================================================
=================================================== ===========================================================
.. envvar:: fish_pager_color_progress the progress bar at the bottom left corner
.. envvar:: fish_pager_color_background the background color of a line
.. envvar:: fish_pager_color_prefix the prefix string, i.e. the string that is to be completed
.. envvar:: fish_pager_color_completion the completion itself, i.e. the proposed rest of the string
.. envvar:: fish_pager_color_description the completion description
.. envvar:: fish_pager_color_selected_background background of the selected completion
.. envvar:: fish_pager_color_selected_prefix prefix of the selected completion
.. envvar:: fish_pager_color_selected_completion suffix of the selected completion
.. envvar:: fish_pager_color_selected_description description of the selected completion
.. envvar:: fish_pager_color_secondary_background background of every second unselected completion
.. envvar:: fish_pager_color_secondary_prefix prefix of every second unselected completion
.. envvar:: fish_pager_color_secondary_completion suffix of every second unselected completion
.. envvar:: fish_pager_color_secondary_description description of every second unselected completion
=================================================== ===========================================================
When the secondary or selected variables aren't set or are empty, the normal variables are used, except for ``$fish_pager_color_selected_background``, where the background of ``$fish_color_search_match`` is tried first.