1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-01 16:32:54 +03:00
kakoune/doc/pages/faces.asciidoc

177 lines
5.0 KiB
Plaintext
Raw Normal View History

= Faces
== Declaration
2020-05-28 19:37:26 +03:00
A 'face' determines how text is displayed, it has a foreground
2016-02-11 00:03:49 +03:00
color, a background color, and some attributes. The value of a face has the
following format:
-----------------------------------------
2019-12-03 13:17:33 +03:00
[fg_color][,bg_color][+attributes][@base]
-----------------------------------------
'fg_color', 'bg_color'::
2017-11-02 12:37:39 +03:00
a color whose value can be expressed in the following formats:
*black*, *red*, *green*, *yellow*, *blue*, *magenta*, *cyan*, *white*:::
*bright-black*, *bright-red*, *bright-green*, *bright-yellow*:::
*bright-blue*, *bright-magenta*, *bright-cyan*, *bright-white*:::
2017-11-02 12:37:39 +03:00
a named color
*default*:::
keep the existing color
*rgb:RRGGBB*:::
hexadecimal value
*rgba:RRGGBBAA*:::
hexadecimal value
2019-12-03 13:17:33 +03:00
if unspecified, *default* is used.
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.
'attributes'::
2017-11-02 12:37:39 +03:00
string whose individual letters set an attribute:
*u*:::
underline
*r*:::
reverse
*b*:::
bold
*B*:::
blink
*d*:::
dim
*i*:::
italic
2020-11-02 22:55:15 +03:00
*s*:::
strikethrough
*F*:::
2020-05-28 19:37:26 +03: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
*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
'base'::
The base face on which this face applies, which can be any face name,
2020-05-28 19:37:26 +03:00
as long as no cycle is introduced. A face can reference itself, in
which case it will apply on top of the parent scope version.
== Builtin faces
2016-04-08 19:00:24 +03:00
The following default faces are used by color schemes to highlight certain
2016-02-11 00:03:49 +03:00
areas of the user interface:
*Default*::
2017-11-02 12:37:39 +03:00
default colors
*PrimarySelection*::
2017-11-02 12:37:39 +03:00
main selection face for every selected character except the cursor
*SecondarySelection*::
2017-11-02 12:37:39 +03:00
secondary selection face for every selected character except the cursor
*PrimaryCursor*::
2017-11-02 12:37:39 +03:00
cursor of the primary selection
*SecondaryCursor*::
2017-11-02 12:37:39 +03:00
cursor of the secondary selection
*PrimaryCursorEol*::
2020-05-28 19:37:26 +03:00
cursor of the primary selection when it lies on an end of line character
*SecondaryCursorEol*::
2020-05-28 19:37:26 +03:00
cursor of the secondary selection when it lies on an end of line character
*MenuForeground*::
2017-11-02 12:37:39 +03:00
face for the selected element in menus
*MenuBackground*::
2017-11-02 12:37:39 +03:00
face for the not selected elements in menus
*MenuInfo*::
2017-11-02 12:37:39 +03:00
face for additional information for elements in menus
*Information*::
2017-11-02 12:37:39 +03:00
face for the informations windows and information messages
*Error*::
2017-11-02 12:37:39 +03:00
face of error messages
*StatusLine*::
2017-11-02 12:37:39 +03:00
face used for the status line
*StatusLineMode*::
2017-11-02 12:37:39 +03:00
face used for the current mode except the normal mode
*StatusLineInfo*::
2017-11-02 12:37:39 +03:00
face used for special information
*StatusLineValue*::
2017-11-02 12:37:39 +03:00
face used for special values (numeric prefixes, registers, etc.)
*StatusCursor*::
2017-11-02 12:37:39 +03:00
face used for the status line cursor
*Prompt*::
2017-11-02 12:37:39 +03:00
face used prompt displayed on the status line
2016-02-17 16:55:19 +03:00
*BufferPadding*::
face applied on the `~` characters that follow the last line of a buffer
2021-06-13 05:12:03 +03:00
=== Builtin highlighter faces
The following faces are used by builtin highlighters if enabled.
(See <<highlighters#,`:doc highlighters`>>).
*LineNumbers*::
face used by the `number-lines` highlighter
*LineNumberCursor*::
face used to highlight the line number of the main selection
*LineNumbersWrapped*::
face used to highlight the line number of wrapped lines
*MatchingChar*::
face used by the `show-matching` highlighter
*Whitespace*::
face used by the `show-whitespaces` highlighter
*WrapMarker*::
face used by the `wrap -marker` highlighter
== Markup strings
In certain contexts, Kakoune can take a markup string, which is a string
2020-05-28 19:37:26 +03:00
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.
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
(`\\`).
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 19:37:26 +03:00
being incorrectly interpreted as markup instruction.
----
echo -markup "{Information}name:{\} %val{bufname}"
----