highlight_defs.h
Go to the documentation of this file.
1 #ifndef NVIM_HIGHLIGHT_DEFS_H
2 #define NVIM_HIGHLIGHT_DEFS_H
3 
4 #include <inttypes.h>
5 
6 #include "nvim/macros.h"
7 
8 typedef int32_t RgbValue;
9 
13 typedef enum {
14  HL_INVERSE = 0x01,
15  HL_BOLD = 0x02,
16  HL_ITALIC = 0x04,
17  HL_UNDERLINE = 0x08,
18  HL_UNDERCURL = 0x10,
19  HL_STANDOUT = 0x20,
21 } HlAttrFlags;
22 
25 typedef struct attr_entry {
29  int hl_blend;
30 } HlAttrs;
31 
32 #define HLATTRS_INIT (HlAttrs) { \
33  .rgb_ae_attr = 0, \
34  .cterm_ae_attr = 0, \
35  .rgb_fg_color = -1, \
36  .rgb_bg_color = -1, \
37  .rgb_sp_color = -1, \
38  .cterm_fg_color = 0, \
39  .cterm_bg_color = 0, \
40  .hl_blend = -1, \
41 }
42 
45 typedef enum {
46  HLF_8 = 0 // Meta & special keys listed with ":map", text that is
47  // displayed different from what it is
48  , HLF_EOB // after the last line in the buffer
49  , HLF_TERM // terminal cursor focused
50  , HLF_TERMNC // terminal cursor unfocused
51  , HLF_AT // @ characters at end of screen, characters that
52  // don't really exist in the text
53  , HLF_D // directories in CTRL-D listing
54  , HLF_E // error messages
55  , HLF_I // incremental search
56  , HLF_L // last search string
57  , HLF_M // "--More--" message
58  , HLF_CM // Mode (e.g., "-- INSERT --")
59  , HLF_N // line number for ":number" and ":#" commands
60  , HLF_CLN // current line number
61  , HLF_R // return to continue message and yes/no questions
62  , HLF_S // status lines
63  , HLF_SNC // status lines of not-current windows
64  , HLF_C // column to separate vertically split windows
65  , HLF_T // Titles for output from ":set all", ":autocmd" etc.
66  , HLF_V // Visual mode
67  , HLF_VNC // Visual mode, autoselecting and not clipboard owner
68  , HLF_W // warning messages
69  , HLF_WM // Wildmenu highlight
70  , HLF_FL // Folded line
71  , HLF_FC // Fold column
72  , HLF_ADD // Added diff line
73  , HLF_CHD // Changed diff line
74  , HLF_DED // Deleted diff line
75  , HLF_TXD // Text Changed in diff line
76  , HLF_SC // Sign column
77  , HLF_CONCEAL // Concealed text
78  , HLF_SPB // SpellBad
79  , HLF_SPC // SpellCap
80  , HLF_SPR // SpellRare
81  , HLF_SPL // SpellLocal
82  , HLF_PNI // popup menu normal item
83  , HLF_PSI // popup menu selected item
84  , HLF_PSB // popup menu scrollbar
85  , HLF_PST // popup menu scrollbar thumb
86  , HLF_TP // tabpage line
87  , HLF_TPS // tabpage line selected
88  , HLF_TPF // tabpage line filler
89  , HLF_CUC // 'cursorcolumn'
90  , HLF_CUL // 'cursorline'
91  , HLF_MC // 'colorcolumn'
92  , HLF_QFL // selected quickfix line
93  , HLF_0 // Whitespace
94  , HLF_INACTIVE // NormalNC: Normal text in non-current windows
95  , HLF_MSGSEP // message separator line
96  , HLF_NFLOAT // Floating window
97  , HLF_MSG // Message area
98  , HLF_COUNT // MUST be the last one
99 } hlf_T;
100 
101 EXTERN const char *hlf_names[] INIT(= {
102  [HLF_8] = "SpecialKey",
103  [HLF_EOB] = "EndOfBuffer",
104  [HLF_TERM] = "TermCursor",
105  [HLF_TERMNC] = "TermCursorNC",
106  [HLF_AT] = "NonText",
107  [HLF_D] = "Directory",
108  [HLF_E] = "ErrorMsg",
109  [HLF_I] = "IncSearch",
110  [HLF_L] = "Search",
111  [HLF_M] = "MoreMsg",
112  [HLF_CM] = "ModeMsg",
113  [HLF_N] = "LineNr",
114  [HLF_CLN] = "CursorLineNr",
115  [HLF_R] = "Question",
116  [HLF_S] = "StatusLine",
117  [HLF_SNC] = "StatusLineNC",
118  [HLF_C] = "VertSplit",
119  [HLF_T] = "Title",
120  [HLF_V] = "Visual",
121  [HLF_VNC] = "VisualNC",
122  [HLF_W] = "WarningMsg",
123  [HLF_WM] = "WildMenu",
124  [HLF_FL] = "Folded",
125  [HLF_FC] = "FoldColumn",
126  [HLF_ADD] = "DiffAdd",
127  [HLF_CHD] = "DiffChange",
128  [HLF_DED] = "DiffDelete",
129  [HLF_TXD] = "DiffText",
130  [HLF_SC] = "SignColumn",
131  [HLF_CONCEAL] = "Conceal",
132  [HLF_SPB] = "SpellBad",
133  [HLF_SPC] = "SpellCap",
134  [HLF_SPR] = "SpellRare",
135  [HLF_SPL] = "SpellLocal",
136  [HLF_PNI] = "Pmenu",
137  [HLF_PSI] = "PmenuSel",
138  [HLF_PSB] = "PmenuSbar",
139  [HLF_PST] = "PmenuThumb",
140  [HLF_TP] = "TabLine",
141  [HLF_TPS] = "TabLineSel",
142  [HLF_TPF] = "TabLineFill",
143  [HLF_CUC] = "CursorColumn",
144  [HLF_CUL] = "CursorLine",
145  [HLF_MC] = "ColorColumn",
146  [HLF_QFL] = "QuickFixLine",
147  [HLF_0] = "Whitespace",
148  [HLF_INACTIVE] = "NormalNC",
149  [HLF_MSGSEP] = "MsgSeparator",
150  [HLF_NFLOAT] = "NormalFloat",
151  [HLF_MSG] = "MsgArea",
152 });
153 
154 
155 EXTERN int highlight_attr[HLF_COUNT]; // Highl. attr for each context.
156 EXTERN int highlight_attr_last[HLF_COUNT]; // copy for detecting changed groups
157 EXTERN int highlight_user[9]; // User[1-9] attributes
158 EXTERN int highlight_stlnc[9]; // On top of user
159 EXTERN int cterm_normal_fg_color INIT(= 0);
160 EXTERN int cterm_normal_bg_color INIT(= 0);
161 EXTERN RgbValue normal_fg INIT(= -1);
162 EXTERN RgbValue normal_bg INIT(= -1);
163 EXTERN RgbValue normal_sp INIT(= -1);
164 
165 typedef enum {
173 } HlKind;
174 
175 typedef struct {
177  HlKind kind;
178  int id1;
179  int id2;
180 } HlEntry;
181 
182 #endif // NVIM_HIGHLIGHT_DEFS_H
int id2
Definition: highlight_defs.h:179
Definition: highlight_defs.h:81
Definition: highlight_defs.h:76
Definition: highlight_defs.h:93
Definition: highlight_defs.h:16
Definition: highlight_defs.h:64
Definition: highlight_defs.h:48
int hl_blend
Definition: highlight_defs.h:29
Definition: highlight_defs.h:172
Definition: highlight_defs.h:91
EXTERN int highlight_attr[HLF_COUNT]
Definition: highlight_defs.h:155
Definition: highlight_defs.h:19
Definition: highlight_defs.h:58
Definition: highlight_defs.h:92
Definition: highlight_defs.h:17
EXTERN const char *hlf_names[] INIT(={[HLF_8]="SpecialKey", [HLF_EOB]="EndOfBuffer", [HLF_TERM]="TermCursor", [HLF_TERMNC]="TermCursorNC", [HLF_AT]="NonText", [HLF_D]="Directory", [HLF_E]="ErrorMsg", [HLF_I]="IncSearch", [HLF_L]="Search", [HLF_M]="MoreMsg", [HLF_CM]="ModeMsg", [HLF_N]="LineNr", [HLF_CLN]="CursorLineNr", [HLF_R]="Question", [HLF_S]="StatusLine", [HLF_SNC]="StatusLineNC", [HLF_C]="VertSplit", [HLF_T]="Title", [HLF_V]="Visual", [HLF_VNC]="VisualNC", [HLF_W]="WarningMsg", [HLF_WM]="WildMenu", [HLF_FL]="Folded", [HLF_FC]="FoldColumn", [HLF_ADD]="DiffAdd", [HLF_CHD]="DiffChange", [HLF_DED]="DiffDelete", [HLF_TXD]="DiffText", [HLF_SC]="SignColumn", [HLF_CONCEAL]="Conceal", [HLF_SPB]="SpellBad", [HLF_SPC]="SpellCap", [HLF_SPR]="SpellRare", [HLF_SPL]="SpellLocal", [HLF_PNI]="Pmenu", [HLF_PSI]="PmenuSel", [HLF_PSB]="PmenuSbar", [HLF_PST]="PmenuThumb", [HLF_TP]="TabLine", [HLF_TPS]="TabLineSel", [HLF_TPF]="TabLineFill", [HLF_CUC]="CursorColumn", [HLF_CUL]="CursorLine", [HLF_MC]="ColorColumn", [HLF_QFL]="QuickFixLine", [HLF_0]="Whitespace", [HLF_INACTIVE]="NormalNC", [HLF_MSGSEP]="MsgSeparator", [HLF_NFLOAT]="NormalFloat", [HLF_MSG]="MsgArea",})
Definition: highlight_defs.h:69
Definition: highlight_defs.h:68
Definition: highlight_defs.h:66
Definition: highlight_defs.h:84
Definition: highlight_defs.h:71
int id1
Definition: highlight_defs.h:178
Definition: highlight_defs.h:73
Definition: highlight_defs.h:74
Definition: highlight_defs.h:75
Definition: highlight_defs.h:18
Definition: highlight_defs.h:77
Definition: highlight_defs.h:25
Definition: highlight_defs.h:85
int16_t rgb_ae_attr
Definition: highlight_defs.h:26
RgbValue rgb_bg_color
Definition: highlight_defs.h:27
Definition: highlight_defs.h:96
Definition: highlight_defs.h:55
#define EXTERN
Definition: macros.h:7
Definition: highlight_defs.h:169
Definition: highlight_defs.h:167
Definition: highlight_defs.h:175
Definition: highlight_defs.h:50
Definition: highlight_defs.h:166
int cterm_bg_color
Definition: highlight_defs.h:28
Definition: highlight_defs.h:54
EXTERN int highlight_attr_last[HLF_COUNT]
Definition: highlight_defs.h:156
Definition: highlight_defs.h:86
Definition: highlight_defs.h:78
Definition: highlight_defs.h:88
Definition: highlight_defs.h:15
Definition: highlight_defs.h:95
Definition: highlight_defs.h:14
hlf_T
Definition: highlight_defs.h:45
Definition: highlight_defs.h:82
Definition: highlight_defs.h:70
Definition: highlight_defs.h:60
Definition: highlight_defs.h:87
Definition: highlight_defs.h:79
RgbValue rgb_sp_color
Definition: highlight_defs.h:27
Definition: highlight_defs.h:171
HlAttrs attr
Definition: highlight_defs.h:176
Definition: highlight_defs.h:65
EXTERN int highlight_user[9]
Definition: highlight_defs.h:157
Definition: highlight_defs.h:80
EXTERN int highlight_stlnc[9]
Definition: highlight_defs.h:158
Definition: highlight_defs.h:170
int32_t RgbValue
Definition: highlight_defs.h:8
int cterm_fg_color
Definition: highlight_defs.h:28
Definition: highlight_defs.h:98
Definition: highlight_defs.h:46
HlKind
Definition: highlight_defs.h:165
Definition: highlight_defs.h:94
Definition: highlight_defs.h:56
Definition: highlight_defs.h:168
Definition: highlight_defs.h:49
Definition: highlight_defs.h:51
Definition: highlight_defs.h:67
Definition: highlight_defs.h:89
Definition: highlight_defs.h:72
RgbValue rgb_fg_color
Definition: highlight_defs.h:27
int16_t cterm_ae_attr
HlAttrFlags.
Definition: highlight_defs.h:26
Definition: highlight_defs.h:97
Definition: highlight_defs.h:57
Definition: highlight_defs.h:53
Definition: highlight_defs.h:83
HlKind kind
Definition: highlight_defs.h:177
Definition: highlight_defs.h:61
Definition: highlight_defs.h:62
Definition: highlight_defs.h:63
Definition: highlight_defs.h:20
Definition: highlight_defs.h:90
struct attr_entry HlAttrs
Definition: highlight_defs.h:59
HlAttrFlags
Definition: highlight_defs.h:13