summaryrefslogtreecommitdiff
path: root/doc/pages/faces.asciidoc
blob: 1b9ef46883cf0894e3f8f74ded7d342caacf541a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
= Faces

== Declaration

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
following format:

-----------------------------------------------------------
[fg_color][,bg_color[,underline_color]][+attributes][@base]
-----------------------------------------------------------

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 color of the base face (see below):::
            *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 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:
        *u*:::
            underline
        *c*:::
            curly underline
            Note: This takes precedence over underline if both are specified.
        *U*:::
            double underline
            Note: This takes precedence over underline and curly underline if also specified.
        *r*:::
            reverse
        *b*:::
            bold
        *B*:::
            blink
        *d*:::
            dim
        *i*:::
            italic
        *s*:::
            strikethrough
        *F*:::
            final::::
                Override the previous face instead of merging with it. Can
                only be replaced if another face with the final attribute
                is applied.
        *f*:::
            final foreground::::
                Same as final, but only applies to a face's foreground color.
        *g*:::
            final background::::
                Same as final, but only applies to a face's background color.
        *a*:::
            final attributes::::
                Same as final, but only applies to a face's attributes.

base::
    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.

== Built-in faces

The following faces are used by color schemes to highlight certain areas of
the user interface:

*Default*::
    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.

*PrimarySelection*::
    Main selection face for every selected character except the cursor.

*SecondarySelection*::
    Secondary selection face for every selected character except the cursor.

*PrimaryCursor*::
    Cursor of the primary selection.

*SecondaryCursor*::
    Cursor of the secondary selection.

*PrimaryCursorEol*::
    Cursor of the primary selection when it lies on an EOL (end of line)
    character.

*SecondaryCursorEol*::
    Cursor of the secondary selection when it lies on an EOL (end of line)
    character.

*MenuForeground*::
    Face for items selected in menus.

*MenuBackground*::
    Face for items not selected in menus.

*MenuInfo*::
    Face for the additional information displayed when selecting items in menus.

*Information*::
    Face for windows and messages displaying other information.

*InlineInformation*::
    Face for windows and messages displaying inline information.

*Error*::
    Face for errors reported by Kakoune in the status line.

*DiagnosticError*::
    Face for errors reported by external tools in the buffer.

*DiagnosticWarning*::
    Face for warnings reported by external tools in the buffer.

*StatusLine*::
    Face for the status line.

*StatusLineMode*::
    Face for the current mode, except normal mode.

*StatusLineInfo*::
    Face for special information.

*StatusLineValue*::
    Face for special values (numeric prefixes, registers, etc.).

*StatusCursor*::
    Face for the status line cursor.

*Prompt*::
    Face for the prompt displayed on the status line.

*BufferPadding*::
    Face applied on the *~* characters that follow the last line of a buffer.

=== Built-in highlighter faces

The following faces are used by built-in 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 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.

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 as `\{`, and a
literal backslash (`\`) character is written as `\\`.

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.

For example, this will prevent any `{` in the current buffer name from being
incorrectly interpreted as markup.

----
echo -markup "{Information}name:{\} %val{bufname}"
----