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
|
|
|
|
2020-05-28 18:37:26 +02:00
|
|
|
A 'face' determines how text is displayed, it has a foreground
|
2016-02-10 22:03:49 +01:00
|
|
|
color, a background color, and some attributes. The value of a face has the
|
|
|
|
following format:
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2020-05-02 04:57:36 +02:00
|
|
|
-----------------------------------------
|
2019-12-03 11:17:33 +01:00
|
|
|
[fg_color][,bg_color][+attributes][@base]
|
2020-05-02 04:57:36 +02:00
|
|
|
-----------------------------------------
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
'fg_color', 'bg_color'::
|
2017-11-02 10:37:39 +01:00
|
|
|
a color whose value can be expressed in the following formats:
|
|
|
|
*black*, *red*, *green*, *yellow*, *blue*, *magenta*, *cyan*, *white*:::
|
2019-03-23 01:38:21 +01:00
|
|
|
*bright-black*, *bright-red*, *bright-green*, *bright-yellow*:::
|
|
|
|
*bright-blue*, *bright-magenta*, *bright-cyan*, *bright-white*:::
|
2017-11-02 10:37:39 +01:00
|
|
|
a named color
|
|
|
|
*default*:::
|
|
|
|
keep the existing color
|
|
|
|
*rgb:RRGGBB*:::
|
|
|
|
hexadecimal value
|
2020-05-02 04:57:36 +02:00
|
|
|
*rgba:RRGGBBAA*:::
|
|
|
|
hexadecimal value
|
2019-12-03 11:17:33 +01:00
|
|
|
if unspecified, *default* is used.
|
2020-05-02 04:57:36 +02:00
|
|
|
Alpha values are used to blend the face onto either its base or the existing
|
|
|
|
color. For technical reasons alpha values must be >16 if specified.
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
'attributes'::
|
2017-11-02 10:37:39 +01:00
|
|
|
string whose individual letters set an attribute:
|
|
|
|
*u*:::
|
|
|
|
underline
|
|
|
|
*r*:::
|
|
|
|
reverse
|
|
|
|
*b*:::
|
|
|
|
bold
|
|
|
|
*B*:::
|
|
|
|
blink
|
|
|
|
*d*:::
|
|
|
|
dim
|
|
|
|
*i*:::
|
|
|
|
italic
|
2018-09-23 15:17:12 +02:00
|
|
|
*F*:::
|
2020-05-28 18:37:26 +02:00
|
|
|
final, override the previous face instead of merging with it,
|
|
|
|
and this face will only be replaced if another face with
|
|
|
|
the final attribute is applied
|
2018-09-23 15:17:12 +02:00
|
|
|
*f*:::
|
|
|
|
final foreground, as final but only applies to face's
|
|
|
|
foreground color
|
|
|
|
*g*:::
|
|
|
|
final background, as final but only applies to face's
|
|
|
|
background color
|
|
|
|
*a*:::
|
|
|
|
final attributes, as final but only applies to face's
|
|
|
|
attributes
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2019-04-23 17:44:30 +02:00
|
|
|
'base'::
|
|
|
|
The base face on which this face applies, which can be any face name,
|
2020-05-28 18:37:26 +02:00
|
|
|
as long as no cycle is introduced. A face can reference itself, in
|
2019-04-23 17:44:30 +02:00
|
|
|
which case it will apply on top of the parent scope version.
|
|
|
|
|
2017-11-02 03:03:24 +01:00
|
|
|
== Builtin faces
|
|
|
|
|
2016-04-08 18:00:24 +02:00
|
|
|
The following default faces are used by color schemes to highlight certain
|
2016-02-10 22:03:49 +01:00
|
|
|
areas of the user interface:
|
2016-02-02 20:15:12 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*Default*::
|
2017-11-02 10:37:39 +01:00
|
|
|
default colors
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*PrimarySelection*::
|
2017-11-02 10:37:39 +01:00
|
|
|
main selection face for every selected character except the cursor
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*SecondarySelection*::
|
2017-11-02 10:37:39 +01:00
|
|
|
secondary selection face for every selected character except the cursor
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*PrimaryCursor*::
|
2017-11-02 10:37:39 +01:00
|
|
|
cursor of the primary selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*SecondaryCursor*::
|
2017-11-02 10:37:39 +01:00
|
|
|
cursor of the secondary selection
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2018-02-24 11:24:06 +01:00
|
|
|
*PrimaryCursorEol*::
|
2020-05-28 18:37:26 +02:00
|
|
|
cursor of the primary selection when it lies on an end of line character
|
2018-02-24 11:24:06 +01:00
|
|
|
|
|
|
|
*SecondaryCursorEol*::
|
2020-05-28 18:37:26 +02:00
|
|
|
cursor of the secondary selection when it lies on an end of line character
|
2018-02-24 11:24:06 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*MenuForeground*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face for the selected element in menus
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*MenuBackground*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face for the not selected elements in menus
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-12-16 04:49:14 +01:00
|
|
|
*MenuInfo*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face for additional information for elements in menus
|
2016-12-16 04:49:14 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*Information*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face for the informations windows and information messages
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*Error*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face of error messages
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*StatusLine*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face used for the status line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-12-16 04:49:14 +01:00
|
|
|
*StatusLineMode*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face used for the current mode except the normal mode
|
2016-12-16 04:49:14 +01:00
|
|
|
|
|
|
|
*StatusLineInfo*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face used for special information
|
2016-12-16 04:49:14 +01:00
|
|
|
|
|
|
|
*StatusLineValue*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face used for special values (numeric prefixes, registers, etc.)
|
2016-12-16 04:49:14 +01:00
|
|
|
|
2016-02-03 18:15:35 +01:00
|
|
|
*StatusCursor*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face used for the status line cursor
|
2016-02-03 18:15:35 +01:00
|
|
|
|
|
|
|
*Prompt*::
|
2017-11-02 10:37:39 +01:00
|
|
|
face used prompt displayed on the status line
|
2016-02-03 18:15:35 +01:00
|
|
|
|
2016-02-17 14:55:19 +01:00
|
|
|
*BufferPadding*::
|
2018-09-09 11:01:45 +02:00
|
|
|
face applied on the `~` characters that follow the last line of a buffer
|
2016-12-16 04:49:14 +01:00
|
|
|
|
2021-06-13 04:12:03 +02:00
|
|
|
=== Builtin highlighter faces
|
2018-05-18 15:47:44 +02:00
|
|
|
|
|
|
|
The following faces are used by builtin highlighters if enabled.
|
2018-09-09 11:01:45 +02:00
|
|
|
(See <<highlighters#,`:doc highlighters`>>).
|
2018-05-18 15:47:44 +02:00
|
|
|
|
|
|
|
*LineNumbers*::
|
2018-07-08 11:11:04 +02:00
|
|
|
face used by the `number-lines` highlighter
|
2018-05-18 15:47:44 +02:00
|
|
|
|
|
|
|
*LineNumberCursor*::
|
|
|
|
face used to highlight the line number of the main selection
|
|
|
|
|
|
|
|
*LineNumbersWrapped*::
|
|
|
|
face used to highlight the line number of wrapped lines
|
|
|
|
|
|
|
|
*MatchingChar*::
|
2018-07-08 11:11:04 +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*::
|
2018-07-08 11:11:04 +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*::
|
|
|
|
face used by the `wrap -marker` highlighter
|
|
|
|
|
2018-09-25 08:41:53 +02:00
|
|
|
== Markup strings
|
|
|
|
|
|
|
|
In certain contexts, Kakoune can take a markup string, which is a string
|
2020-05-28 18:37:26 +02:00
|
|
|
containing formatting information. In these strings, the {facename}
|
2018-09-25 08:41:53 +02:00
|
|
|
syntax will enable the face facename until another face gets activated,
|
|
|
|
or the end of the string is reached.
|
|
|
|
|
|
|
|
For example, the following command displays the text "default" in the
|
|
|
|
Default face, and "error" in the Error face:
|
|
|
|
|
|
|
|
----
|
|
|
|
echo -markup 'default {Error}error{Default} default'
|
|
|
|
----
|
|
|
|
|
|
|
|
Inside a markup string, a literal `{` character is written `\{`, and a
|
|
|
|
literal backslash (`\`) that precedes a '{' character is escaped as well
|
|
|
|
(`\\`).
|
2019-11-28 10:22:40 +01:00
|
|
|
|
|
|
|
The `{\}` string disables markup processing for the rest of the line,
|
|
|
|
and can be used to avoid having to escape text that might be mistaken
|
|
|
|
for markup instructions.
|
|
|
|
|
|
|
|
For example this will prevent any '{' in the current buffer name from
|
2020-05-28 18:37:26 +02:00
|
|
|
being incorrectly interpreted as markup instruction.
|
2019-11-28 10:22:40 +01:00
|
|
|
|
|
|
|
----
|
|
|
|
echo -markup "{Information}name:{\} %val{bufname}"
|
|
|
|
----
|