docs: Move color variables to interactive

A bunch of our variables are only relevant for interactive use, but
this is two whole sections on them. Simply move them inside "Syntax
highlighting" and leave the link in Special Variables.
This commit is contained in:
Fabian Homborg 2021-06-06 16:16:47 +02:00
parent f90577ddf6
commit b0b8cb0129
2 changed files with 78 additions and 79 deletions

View file

@ -84,6 +84,84 @@ When the cursor is over a parenthesis or a quote, fish also highlights its match
To customize the syntax highlighting, you can set the environment variables listed in the :ref:`Variables for changing highlighting colors <variables-color>` section.
.. _variables-color:
Syntax highlighting variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The colors used by fish for syntax highlighting can be configured by changing the values of a various variables. The value of these variables can be one of the colors accepted by the :ref:`set_color <cmd-set_color>` command. The ``--bold`` or ``-b`` switches accepted by ``set_color`` are also accepted.
Example: to make errors highlighted and red, use::
set fish_color_error red --bold
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 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_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_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_cancel`` the '^C' indicator on a canceled command
``fish_color_search_match`` history search matches and selected pager items (background only)
========================================== =====================================================================
.. _variables-color-pager:
Pager color variables
^^^^^^^^^^^^^^^^^^^^^^^
fish will sometimes present a list of choices in a table, called the pager.
Example: to set the background of each pager row, use::
set fish_pager_color_background --background=white
To have black text on alternating white and gray backgrounds::
set fish_pager_color_prefix black
set fish_pager_color_completion black
set fish_pager_color_description black
set fish_pager_color_background --background=white
set fish_pager_color_secondary_background --background=brwhite
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
========================================== ===========================================================
.. _abbreviations:
Abbreviations

View file

@ -1319,85 +1319,6 @@ If fish encounters a problem while executing a command, the status variable may
If a process exits through a signal, the exit status will be 128 plus the number of the signal.
.. _variables-color:
Syntax highlighting variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The colors used by fish for syntax highlighting can be configured by changing the values of a various variables. The value of these variables can be one of the colors accepted by the :ref:`set_color <cmd-set_color>` command. The ``--bold`` or ``-b`` switches accepted by ``set_color`` are also accepted.
Example: to make errors highlighted and red, use::
set fish_color_error red --bold
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 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_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_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_cancel`` the '^C' indicator on a canceled command
``fish_color_search_match`` history search matches and selected pager items (background only)
========================================== =====================================================================
.. _variables-color-pager:
Pager color variables
^^^^^^^^^^^^^^^^^^^^^^^
fish will sometimes present a list of choices in a table, called the pager.
Example: to set the background of each pager row, use::
set fish_pager_color_background --background=white
To have black text on alternating white and gray backgrounds::
set fish_pager_color_prefix black
set fish_pager_color_completion black
set fish_pager_color_description black
set fish_pager_color_background --background=white
set fish_pager_color_secondary_background --background=brwhite
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
========================================== ===========================================================
.. _variables-locale:
Locale variables