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