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*
|
|
|
|
The existing color:::
|
|
|
|
*default*
|
|
|
|
A hexadecimal value:::
|
|
|
|
*rgb:RRGGBB*, *rgba:RRGGBBAA*
|
|
|
|
If left unspecified, the value of *default* is used.
|
|
|
|
Alpha values are used to blend the face onto either its base (see below) or
|
|
|
|
else onto whatever color happens to be used at the moment. For technical
|
|
|
|
reasons, alpha values must be >16.
|
|
|
|
|
|
|
|
attributes::
|
|
|
|
A string whose individual letters each set an attribute:
|
2017-11-02 10:37:39 +01:00
|
|
|
*u*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Underline
|
2021-09-07 00:21:26 +02:00
|
|
|
*c*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Curly underline
|
|
|
|
Note: This takes precedence over underline if both are specified.
|
2017-11-02 10:37:39 +01:00
|
|
|
*r*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Reverse
|
2017-11-02 10:37:39 +01:00
|
|
|
*b*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Bold
|
2017-11-02 10:37:39 +01:00
|
|
|
*B*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Blink
|
2017-11-02 10:37:39 +01:00
|
|
|
*d*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Dim
|
2017-11-02 10:37:39 +01:00
|
|
|
*i*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Italic
|
2020-11-02 20:55:15 +01:00
|
|
|
*s*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Strikethrough
|
2018-09-23 15:17:12 +02:00
|
|
|
*F*:::
|
2022-07-16 04:12:57 +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-16 04:12:57 +02:00
|
|
|
Final foreground::::
|
|
|
|
Same as final, but only applies to a face's foreground color.
|
2018-09-23 15:17:12 +02:00
|
|
|
*g*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Final background::::
|
|
|
|
Same as final, but only applies to a face's background color.
|
2018-09-23 15:17:12 +02:00
|
|
|
*a*:::
|
2022-07-16 04:12:57 +02:00
|
|
|
Final attributes::::
|
|
|
|
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::
|
|
|
|
The face onto which the rest of the face applies. Its value can be any
|
|
|
|
face name, as long as no cycle is introduced. A face can reference itself,
|
|
|
|
in which case it will apply on top 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-16 04:12:57 +02:00
|
|
|
Default colors:::
|
|
|
|
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
|
|
|
|
|
|
|
*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-16 04:12:57 +02:00
|
|
|
Inside a markup string, a literal `{` character is written `\{`, and a literal
|
|
|
|
backslash `\` character that precedes a `{` character is escaped as well
|
2018-09-25 08:41:53 +02:00
|
|
|
(`\\`).
|
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}"
|
|
|
|
----
|