2017-11-02 03:03:24 +01:00
|
|
|
= Faces
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Declaration
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
A *face* determines how text is displayed. It has a foreground color,
|
|
|
|
a background color, and some attributes. The value of a face has the
|
2016-02-10 22:03:49 +01:00
|
|
|
following format:
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2021-09-07 00:21:26 +02:00
|
|
|
-----------------------------------------------------------
|
|
|
|
[fg_color][,bg_color[,underline_color]][+attributes][@base]
|
|
|
|
-----------------------------------------------------------
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
fg_color, bg_color, underline_color::
|
|
|
|
A color whose value can be:
|
|
|
|
A named color:::
|
|
|
|
*black*, *red*, *green*, *yellow*, *blue*, *magenta*, *cyan*,
|
|
|
|
*white* *bright-black*, *bright-red*, *bright-green*,
|
|
|
|
*bright-yellow* *bright-blue*, *bright-magenta*, *bright-cyan*,
|
|
|
|
*bright-white*
|
2022-07-24 23:59:56 +02:00
|
|
|
The color of the base face (see below):::
|
2022-07-16 04:12:57 +02:00
|
|
|
*default*
|
|
|
|
A hexadecimal value:::
|
|
|
|
*rgb:RRGGBB*, *rgba:RRGGBBAA*
|
|
|
|
If left unspecified, the value of *default* is used.
|
2022-07-24 23:59:56 +02:00
|
|
|
Alpha values are used to blend the face onto either its base or else onto
|
|
|
|
whatever color happens to be used at the moment. For technical reasons,
|
|
|
|
alpha values must be >16.
|
2022-07-16 04:12:57 +02:00
|
|
|
|
|
|
|
attributes::
|
|
|
|
A string whose individual letters each set an attribute:
|
2017-11-02 10:37:39 +01:00
|
|
|
*u*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
underline
|
2021-09-07 00:21:26 +02:00
|
|
|
*c*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
curly underline
|
2022-07-16 04:12:57 +02:00
|
|
|
Note: This takes precedence over underline if both are specified.
|
2017-11-02 10:37:39 +01:00
|
|
|
*r*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
reverse
|
2017-11-02 10:37:39 +01:00
|
|
|
*b*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
bold
|
2017-11-02 10:37:39 +01:00
|
|
|
*B*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
blink
|
2017-11-02 10:37:39 +01:00
|
|
|
*d*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
dim
|
2017-11-02 10:37:39 +01:00
|
|
|
*i*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
italic
|
2020-11-02 20:55:15 +01:00
|
|
|
*s*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
strikethrough
|
2018-09-23 15:17:12 +02:00
|
|
|
*F*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
final::::
|
|
|
|
Override the previous face instead of merging with it. Can
|
|
|
|
only be replaced if another face with the final attribute
|
|
|
|
is applied.
|
2018-09-23 15:17:12 +02:00
|
|
|
*f*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
final foreground::::
|
2022-07-16 04:12:57 +02:00
|
|
|
Same as final, but only applies to a face's foreground color.
|
2018-09-23 15:17:12 +02:00
|
|
|
*g*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
final background::::
|
2022-07-16 04:12:57 +02:00
|
|
|
Same as final, but only applies to a face's background color.
|
2018-09-23 15:17:12 +02:00
|
|
|
*a*:::
|
2022-07-24 23:59:56 +02:00
|
|
|
final attributes::::
|
2022-07-16 04:12:57 +02:00
|
|
|
Same as final, but only applies to a face's attributes.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
base::
|
2022-07-24 23:59:56 +02:00
|
|
|
The face onto which other faces apply. Its value can be any face name,
|
|
|
|
as long as no cycle is introduced. A face can reference itself, in which
|
|
|
|
case it'll apply on top of the version of the parent scope.
|
2019-04-23 17:44:30 +02:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
== Built-in faces
|
2017-11-02 03:03:24 +01:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
The following faces are used by color schemes to highlight certain areas of
|
|
|
|
the user interface:
|
2016-02-02 20:15:12 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*Default*::
|
2022-07-24 23:59:56 +02:00
|
|
|
default colors:::
|
2022-07-16 04:12:57 +02:00
|
|
|
The default foreground and background colors. If the value of *default*
|
|
|
|
is used here, then the colors used will be your terminal's defaults.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*PrimarySelection*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Main selection face for every selected character except the cursor.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*SecondarySelection*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Secondary selection face for every selected character except the cursor.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*PrimaryCursor*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Cursor of the primary selection.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*SecondaryCursor*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Cursor of the secondary selection.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2018-02-24 11:24:06 +01:00
|
|
|
*PrimaryCursorEol*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Cursor of the primary selection when it lies on an EOL (end of line)
|
|
|
|
character.
|
2018-02-24 11:24:06 +01:00
|
|
|
|
|
|
|
*SecondaryCursorEol*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Cursor of the secondary selection when it lies on an EOL (end of line)
|
|
|
|
character.
|
2018-02-24 11:24:06 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*MenuForeground*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for items selected in menus.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*MenuBackground*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for items not selected in menus.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-12-16 04:49:14 +01:00
|
|
|
*MenuInfo*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for the additional information displayed when selecting items in menus.
|
2016-12-16 04:49:14 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*Information*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for windows and messages displaying other information.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2023-09-28 15:05:46 +02:00
|
|
|
*InlineInformation*::
|
|
|
|
Face for windows and messages displaying inline information.
|
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*Error*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for errors reported by Kakoune in the status line.
|
2021-09-07 08:55:01 +02:00
|
|
|
|
|
|
|
*DiagnosticError*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for errors reported by external tools in the buffer.
|
2021-09-07 08:55:01 +02:00
|
|
|
|
|
|
|
*DiagnosticWarning*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for warnings reported by external tools in the buffer.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*StatusLine*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for the status line.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-12-16 04:49:14 +01:00
|
|
|
*StatusLineMode*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for the current mode, except normal mode.
|
2016-12-16 04:49:14 +01:00
|
|
|
|
|
|
|
*StatusLineInfo*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for special information.
|
2016-12-16 04:49:14 +01:00
|
|
|
|
|
|
|
*StatusLineValue*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for special values (numeric prefixes, registers, etc.).
|
2016-12-16 04:49:14 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*StatusCursor*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for the status line cursor.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*Prompt*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face for the prompt displayed on the status line.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-02-17 14:55:19 +01:00
|
|
|
*BufferPadding*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face applied on the *~* characters that follow the last line of a buffer.
|
2016-12-16 04:49:14 +01:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
=== Built-in highlighter faces
|
2018-05-18 15:47:44 +02:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
The following faces are used by built-in highlighters if enabled.
|
2018-09-09 11:01:45 +02:00
|
|
|
(See <<highlighters#,`:doc highlighters`>>).
|
2018-05-18 15:47:44 +02:00
|
|
|
|
|
|
|
*LineNumbers*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face used by the *number-lines* highlighter.
|
2018-05-18 15:47:44 +02:00
|
|
|
|
|
|
|
*LineNumberCursor*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face used to highlight the line number of the main selection.
|
2018-05-18 15:47:44 +02:00
|
|
|
|
|
|
|
*LineNumbersWrapped*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face used to highlight the line number of wrapped lines.
|
2018-05-18 15:47:44 +02:00
|
|
|
|
|
|
|
*MatchingChar*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face used by the *show-matching* highlighter.
|
2018-05-18 15:47:44 +02:00
|
|
|
|
2016-12-16 04:49:14 +01:00
|
|
|
*Whitespace*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face used by the *show-whitespaces* highlighter.
|
2018-09-25 08:41:53 +02:00
|
|
|
|
2019-11-07 11:09:48 +01:00
|
|
|
*WrapMarker*::
|
2022-07-16 04:12:57 +02:00
|
|
|
Face used by the *wrap-marker* highlighter.
|
2019-11-07 11:09:48 +01:00
|
|
|
|
2018-09-25 08:41:53 +02:00
|
|
|
== Markup strings
|
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
In certain contexts, Kakoune can understand markup strings, which are strings
|
|
|
|
containing formatting information. In these strings, the {facename} syntax
|
|
|
|
will enable the face facename until another face gets activated, or the end
|
|
|
|
of the string is reached.
|
2018-09-25 08:41:53 +02:00
|
|
|
|
|
|
|
For example, the following command displays the text "default" in the
|
2022-07-16 04:12:57 +02:00
|
|
|
*Default* face, and "error" in the *Error* face:
|
2018-09-25 08:41:53 +02:00
|
|
|
|
|
|
|
----
|
|
|
|
echo -markup 'default {Error}error{Default} default'
|
|
|
|
----
|
|
|
|
|
2022-07-24 23:59:56 +02:00
|
|
|
Inside a markup string, a literal `{` character is written as `\{`, and a
|
|
|
|
literal backslash (`\`) character is written as `\\`.
|
2019-11-28 10:22:40 +01:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
The `{\}` string disables markup processing for the rest of the line. It
|
|
|
|
can be used to avoid having to escape text that might be mistaken for markup
|
|
|
|
instructions.
|
2019-11-28 10:22:40 +01:00
|
|
|
|
2022-07-16 04:12:57 +02:00
|
|
|
For example, this will prevent any `{` in the current buffer name from being
|
|
|
|
incorrectly interpreted as markup.
|
2019-11-28 10:22:40 +01:00
|
|
|
|
|
|
|
----
|
|
|
|
echo -markup "{Information}name:{\} %val{bufname}"
|
|
|
|
----
|