repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

refactor: simplify nugu colorscheme

7c3d2d52d9a4050b216a2e0164e8d21e36ecc501

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

- Remove dead terminal_colors block (ignored with termguicolors off;
  neovim forwards ANSI indices to wezterm which resolves its own palette)
- Remove dark/light background detection (cterm indices are mode-agnostic)
- Replace 20 local aliases with direct P. references to palette module
- Reorganize highlight definitions into logical sections
- Remove dead comments from colors/nugu.lua
- Remove unused namespace local in apply function

Changed files (2)

neovim/colors/nugu.lua

Modified
1 --- local const = require 'std.const'
3 1 if vim.g.colors_name then
4 2 vim.cmd [[ highlight clear ]]
5 - -- else
6 - -- NOTE: on linux, this is not needed anymore. check win32
7 - -- vim.opt.background = const.os_background
10 5 vim.g.colors_name = 'nugu'
11 6 vim.opt.termguicolors = false
13 --- this is necessary to toggle light/dark during runtime
14 8 package.loaded['bugabinga.nugu'] = nil
16 10 require 'bugabinga.nugu' ()

neovim/lua/bugabinga/nugu/init.lua

Modified
1 -local palette = require 'bugabinga.nugu.palette'
3 --- cterm indices into the wezterm palette
4 -local debug = (palette.debug)
5 -local error = (palette.error)
6 -local info = (palette.info)
7 -local warning = (palette.warning)
9 -local content_normal = palette.content_normal
10 -local content_backdrop = palette.content_backdrop
11 -local content_accent = palette.content_accent
12 -local content_minor = palette.content_minor
13 -local content_focus = palette.content_focus
14 -local content_unfocus = palette.content_unfocus
15 -local content_important_global = palette.content_important_global
16 -local content_important_local = palette.content_important_local
18 -local ui_normal = palette.ui_normal
19 -local ui_backdrop = palette.ui_backdrop
20 -local ui_accent = palette.ui_accent
21 -local ui_minor = palette.ui_minor
22 -local ui_focus = palette.ui_focus
23 -local ui_unfocus = palette.ui_unfocus
24 -local ui_important_global = palette.ui_important_global
25 -local ui_important_local = palette.ui_important_local
27 --- terminal colors for neovim's built-in :terminal
28 --- must match wezterm's ANSI palette RGB values
29 -local terminal_colors = {
30 - dark = {
31 - '#121212', '#e46479', '#7ba1aa', '#9e9a69',
32 - '#b59ae4', '#d151d1', '#5d5d5d', '#ededed',
33 - '#8b8b8b', '#3ec5dd', '#6f6f6f', '#242424',
34 - '#dfd3f3', '#d86dd8', '#c9b6eb', '#f3effb',
35 - },
36 - light = {
37 - '#ededed', '#c0223c', '#184e5b', '#242317',
38 - '#715696', '#ae2eae', '#6f6f6f', '#121212',
39 - '#3b3b3b', '#13616e', '#5d5d5d', '#dbdbdb',
40 - '#4f3c69', '#922792', '#604980', '#3e2f53',
41 - },
44 -local is_dark = vim.opt.background:get() == 'dark'
45 -local term_pal = is_dark and terminal_colors.dark or terminal_colors.light
46 -for i = 0, 15 do
47 - vim.g['terminal_color_' .. i] = term_pal[i + 1]
48 -end
1 +local P = require 'bugabinga.nugu.palette'
50 3 local set_group_properties = function ( self, properties )
51 4 vim.validate( 'properties', properties, 'table' )
98 51 __newindex = link_group,
101 -_.Debug { fg = ui_normal, bg = debug, bold = true }
103 -_.Normal { fg = content_normal, bg = content_backdrop }
104 -_.NormalUi { fg = ui_normal, bg = ui_backdrop }
54 +-- editor
55 +_.Normal { fg = P.content_normal, bg = P.content_backdrop }
56 +_.NormalUi { fg = P.ui_normal, bg = P.ui_backdrop }
105 57 _.NormalFloat { bg = _.NormalUi.bg }
106 -_.FloatBorder { fg = ui_accent, bg = _.NormalFloat.bg }
107 -_.FloatBorderCorner { fg = ui_accent, bg = _.Normal.bg }
108 -_.FloatShadow { bg = content_unfocus, blend = 80 }
109 -_.FloatShadowThrough { bg = content_unfocus, blend = 100 }
110 -_.FloatTitle { fg = _.FloatBorder.fg, bg = _.FloatBorder.bg, bold = true }
111 -_.CycleBufferFileName { fg = ui_accent, bold = true }
112 -_.CycleBufferIcon { fg = ui_minor }
113 58 _.EndOfBuffer { bg = _.Normal.bg }
114 -_.Comment { fg = content_important_global, bold = true, italic = true }
115 -_.NotifyBackground = _.NormalUi
116 -_.LineNr { fg = ui_focus, bg = content_backdrop }
117 -_.LineNrAbove { fg = ui_minor, bg = content_backdrop }
118 -_.LineNrBelow { fg = ui_minor, bg = content_backdrop }
59 +_.Cursor { fg = P.content_backdrop, bg = P.content_accent }
60 +_.CursorColumn { bg = P.ui_unfocus }
61 +_.CursorLine { bg = P.ui_unfocus }
62 +_.CursorLineNr { fg = P.ui_focus, bg = P.ui_backdrop }
63 +_.CursorLineSign = _.CursorLineNr
64 +_.ColorColumn { fg = P.ui_important_global, bg = _.Normal.bg }
65 +_.Conceal { fg = P.content_focus, bg = _.Normal.bg }
66 +_.Directory { fg = _.Normal.fg }
67 +_.MatchParen { bg = P.ui_unfocus, bold = true }
68 +_.LineNr { fg = P.ui_focus, bg = P.content_backdrop }
69 +_.LineNrAbove { fg = P.ui_minor, bg = P.content_backdrop }
70 +_.LineNrBelow { fg = P.ui_minor, bg = P.content_backdrop }
119 71 _.FoldColumn = _.LineNrAbove
120 72 _.SignColumn = _.LineNrAbove
121 -_.CursorLine { bg = ui_unfocus }
122 -_.CursorLineNr { fg = ui_focus, bg = ui_backdrop }
123 -_.CursorLineSign = _.CursorLineNr
124 -_.Search { fg = content_backdrop, bg = content_focus }
125 -_.IncSearch { fg = content_backdrop, bg = content_unfocus }
126 -_.CurSearch { fg = content_backdrop, bg = content_important_local }
127 -_.ColorColumn { fg = ui_important_global, bg = _.Normal.bg }
128 -_.Conceal { fg = content_focus, bg = _.Normal.bg }
129 -_.Cursor { fg = content_backdrop, bg = content_accent }
130 --- _.lCursor = _.Cursor
131 --- _.CursorIM = _.Cursor
132 -_.Directory { fg = _.Normal.fg }
133 -_.Added { fg = content_focus }
134 -_.OkMsg = _.Added
135 -_.Removed { fg = error }
136 -_.Changed { fg = content_important_local }
137 -_.DiffAdd = _.Added
138 -_.DiffDelete { fg = content_focus, strikethrough = true }
139 -_.DiffChange { fg = content_important_global }
140 -_.DiffText { fg = content_normal, bg = content_unfocus }
141 -_.CursorColumn { bg = ui_unfocus }
142 -_.MatchParen { bg = ui_unfocus, bold = true }
143 -_.NvimInternalError { fg = error, bg = content_backdrop }
144 --- _.TermCursor = _.Cursor
145 --- _.TermCursorNC = _.Cursor
146 -_.ErrorMsg { fg = error }
147 -_.RedrawDebugClear { fg = content_backdrop, bg = ui_backdrop }
148 -_.RedrawDebugComposed { fg = content_backdrop, bg = ui_unfocus }
149 -_.RedrawDebugRecompose { fg = content_backdrop, bg = error }
150 -_.VertSplit { fg = ui_important_global }
73 +_.NonText { fg = P.content_unfocus }
74 +_.Whitespace = _.NonText
75 +_.SpecialKey { fg = P.error, bg = P.content_unfocus, bold = true }
76 +_.Visual { bg = P.content_unfocus }
77 +_.VisualNOS { bg = P.ui_unfocus }
78 +_.Search { fg = P.content_backdrop, bg = P.content_focus }
79 +_.IncSearch { fg = P.content_backdrop, bg = P.content_unfocus }
80 +_.CurSearch { fg = P.content_backdrop, bg = P.content_important_local }
81 +_.QuickFixLine = _.PmenuSel
151 82 _.Folded = _.Conceal
84 +-- floats
85 +_.FloatBorder { fg = P.ui_accent, bg = _.NormalFloat.bg }
86 +_.FloatBorderCorner { fg = P.ui_accent, bg = _.Normal.bg }
87 +_.FloatShadow { bg = P.content_unfocus, blend = 80 }
88 +_.FloatShadowThrough { bg = P.content_unfocus, blend = 100 }
89 +_.FloatTitle { fg = _.FloatBorder.fg, bg = _.FloatBorder.bg, bold = true }
91 +-- ui chrome
92 +_.StatusLine = _.NormalUi
93 +_.StatusLineNC { fg = P.ui_minor, bg = _.StatusLine.bg }
94 +_.WinBar { fg = P.ui_focus, bg = _.StatusLine.bg }
95 +_.WinBarNC { fg = P.ui_minor, bg = _.StatusLine.bg }
96 +_.TabLine = _.StatusLine
97 +_.TabLineFill = _.StatusLine
98 +_.TabLineSel { fg = P.ui_important_global, bg = _.TabLine.bg, bold = true, underline = true }
99 +_.VertSplit { fg = P.ui_important_global }
100 +_.Title { fg = P.content_important_global, bold = true, underline = true }
152 101 _.ModeMsg { bold = true }
153 102 _.MsgArea = _.NormalUi
154 103 _.MsgSeparator = _.NormalUi
155 104 _.MoreMsg = _.NormalUi
156 -_.NonText { fg = content_unfocus }
157 -_.Whitespace = _.NonText
105 +_.Question { fg = P.ui_important_local, bold = true }
106 +_.WildMenu = _.PmenuSel
107 +_.Debug { fg = P.ui_normal, bg = P.debug, bold = true }
109 +-- menus
158 110 _.Pmenu = _.NormalFloat
159 -_.PmenuSel { fg = ui_important_local, bg = _.Pmenu.bg, bold = true, underline = true }
160 -_.PmenuSbar { fg = ui_minor, bg = _.NormalFloat.bg }
161 -_.PmenuThumb { fg = ui_important_local, bg = _.NormalFloat.bg }
162 -_.PmenuMatch { fg = content_focus, bold = true }
163 -_.PmenuMatchSel { fg = content_focus, bold = true }
164 -_.ComplMatchIns { fg = content_accent }
165 -_.PmenuKind { fg = ui_minor }
166 -_.PmenuKindSel { fg = ui_important_local }
167 -_.BugabingaCmdlineCursor { fg = ui_important_local, bg = ui_unfocus, bold = true }
168 -_.CmdlineBorderSearch { fg = ui_important_global, bg = _.NormalFloat.bg }
169 -_.CmdlineBorderShell { fg = content_focus, bg = _.NormalFloat.bg }
170 -_.CmdlineBorderHelp { fg = info, bg = _.NormalFloat.bg }
171 -_.CmdlineBorderLua { fg = content_focus, bg = _.NormalFloat.bg }
172 -_.CmdlineBorderInput { fg = ui_important_local, bg = _.NormalFloat.bg }
173 -_.CmdlineBorderCmdline { fg = ui_minor, bg = _.NormalFloat.bg }
111 +_.PmenuSel { fg = P.ui_important_local, bg = _.Pmenu.bg, bold = true, underline = true }
112 +_.PmenuSbar { fg = P.ui_minor, bg = _.NormalFloat.bg }
113 +_.PmenuThumb { fg = P.ui_important_local, bg = _.NormalFloat.bg }
114 +_.PmenuMatch { fg = P.content_focus, bold = true }
115 +_.PmenuMatchSel { fg = P.content_focus, bold = true }
116 +_.ComplMatchIns { fg = P.content_accent }
117 +_.PmenuKind { fg = P.ui_minor }
118 +_.PmenuKindSel { fg = P.ui_important_local }
120 +-- cmdline
121 +_.BugabingaCmdlineCursor { fg = P.ui_important_local, bg = P.ui_unfocus, bold = true }
122 +_.CmdlineBorderSearch { fg = P.ui_important_global, bg = _.NormalFloat.bg }
123 +_.CmdlineBorderShell { fg = P.content_focus, bg = _.NormalFloat.bg }
124 +_.CmdlineBorderHelp { fg = P.info, bg = _.NormalFloat.bg }
125 +_.CmdlineBorderLua { fg = P.content_focus, bg = _.NormalFloat.bg }
126 +_.CmdlineBorderInput { fg = P.ui_important_local, bg = _.NormalFloat.bg }
127 +_.CmdlineBorderCmdline { fg = P.ui_minor, bg = _.NormalFloat.bg }
174 128 _.CmdlineBorderCornerSearch { fg = _.CmdlineBorderSearch.fg, bg = _.FloatBorderCorner.bg }
175 129 _.CmdlineBorderCornerShell { fg = _.CmdlineBorderShell.fg, bg = _.FloatBorderCorner.bg }
176 130 _.CmdlineBorderCornerHelp { fg = _.CmdlineBorderHelp.fg, bg = _.FloatBorderCorner.bg }
183 137 _.CmdlineIconLua { fg = _.CmdlineBorderLua.fg }
184 138 _.CmdlineIconInput { fg = _.CmdlineBorderInput.fg }
185 139 _.CmdlineIconCmdline { fg = _.CmdlineBorderCmdline.fg }
186 -_.Question { fg = ui_important_local, bold = true }
187 -_.QuickFixLine = _.PmenuSel
188 -_.SpecialKey { fg = error, bg = content_unfocus, bold = true }
189 -_.SpellBad { fg = error, undercurl = true }
190 -_.SpellCap = _.SpellBad
191 -_.SpellLocal = _.SpellBad
192 -_.SpellRare = _.SpellBad
193 -_.StatusLine = _.NormalUi
194 -_.StatusLineNC { fg = ui_minor, bg = _.StatusLine.bg }
195 -_.WinBar { fg = ui_focus, bg = _.StatusLine.bg }
196 -_.WinBarNC { fg = ui_minor, bg = _.StatusLine.bg }
197 -_.TabLine = _.StatusLine
198 -_.TabLineFill = _.StatusLine
199 -_.TabLineSel { fg = ui_important_global, bg = _.TabLine.bg, bold = true, underline = true }
200 -_.Title { fg = content_important_global, bold = true, underline = true }
201 -_.Visual { bg = content_unfocus }
202 -_.VisualNOS { bg = ui_unfocus }
203 -_.SnippetTabstop { bg = content_unfocus, underline = true }
204 -_.WarningMsg { fg = warning, bold = true }
205 -_.WildMenu = _.PmenuSel
206 -_.TextYankPost { fg = content_backdrop, bg = ui_important_local }
208 -_.String { fg = content_focus, italic = true }
209 -_.Constant = _.String
210 -_.Character = _.String
211 -_.Number = _.String
212 -_.Boolean = _.String
213 -_.Float = _.String
214 -_.Identifier { fg = _.Normal.fg }
215 -_.Function { fg = _.Normal.fg }
216 -_.FunctionDeclaration { fg = _.Function.fg, underline = true }
217 -_.Parameter { fg = content_important_local, bold = true }
218 -_.MutableVariable = { fg = _.Parameter.fg, underline = true }
219 -_.Type { fg = _.Identifier.fg }
220 -_.Delimiter { fg = content_minor }
222 -_.Statement { fg = content_minor }
223 -_.Conditional = _.Statement
224 -_.Repeat = _.Statement
225 -_.Label = _.Statement
226 -_.Operator = _.Statement
227 -_.Keyword = _.Statement
228 -_.Exception = _.Statement
229 -_.StorageClass = _.Statement
230 -_.Structure = _.Statement
231 -_.Typedef = _.Statement
233 -_.PreProc { fg = content_important_global, bold = true }
234 -_.Include = _.PreProc
235 -_.Define = _.PreProc
236 -_.Macro = _.PreProc
237 -_.PreCondit = _.PreProc
239 -_.Special { fg = content_important_global, bold = true }
240 -_.SpecialChar = _.Special
241 -_.Tag = _.Special
242 -_.SpecialComment = _.Special
244 -_.Underlined { underline = true }
245 -_.Bold { bold = true }
246 -_.Italic { italic = true }
248 -_.Ignore { fg = _.Normal.bg }
250 -_.Error { fg = error }
251 -_.Todo { fg = content_important_global, bold = true, underdouble = true }
253 -_.DiagnosticUnnecessary { fg = ui_focus }
254 -_.DiagnosticDeprecated { fg = ui_important_global, strikethrough = true }
255 -_.DiagnosticError { fg = error }
256 -_.DiagnosticWarn { fg = warning }
257 -_.DiagnosticInfo { fg = info }
258 -_.DiagnosticHint { fg = ui_important_local }
259 -_.DiagnosticOk { fg = ui_minor }
141 +-- diagnostics
142 +_.DiagnosticError { fg = P.error }
143 +_.DiagnosticWarn { fg = P.warning }
144 +_.DiagnosticInfo { fg = P.info }
145 +_.DiagnosticHint { fg = P.ui_important_local }
146 +_.DiagnosticOk { fg = P.ui_minor }
147 +_.DiagnosticUnnecessary { fg = P.ui_focus }
148 +_.DiagnosticDeprecated { fg = P.ui_important_global, strikethrough = true }
261 149 _.DiagnosticVirtualTextError = _.DiagnosticError
262 150 _.DiagnosticVirtualTextWarn = _.DiagnosticWarn
263 151 _.DiagnosticVirtualTextInfo = _.DiagnosticInfo
268 156 _.DiagnosticUnderlineInfo { fg = _.DiagnosticInfo.fg, underdashed = true }
269 157 _.DiagnosticUnderlineHint { fg = _.DiagnosticHint.fg, underdotted = true }
270 158 _.DiagnosticUnderlineOk { fg = _.DiagnosticOk.fg }
271 -_.DiagnosticSignError = _.DiagnosticError
272 -_.DiagnosticSignWarn = _.DiagnosticWarn
273 -_.DiagnosticSignInfo = _.DiagnosticInfo
274 -_.DiagnosticSignHint = _.DiagnosticHint
275 -_.DiagnosticSignOk = _.DiagnosticOk
159 +_.DiagnosticSignError = _.DiagnosticError
160 +_.DiagnosticSignWarn = _.DiagnosticWarn
161 +_.DiagnosticSignInfo = _.DiagnosticInfo
162 +_.DiagnosticSignHint = _.DiagnosticHint
163 +_.DiagnosticSignOk = _.DiagnosticOk
277 -_.BugabingaCodeActionFixAll = _.DiagnosticWarn
278 -_.BugabingaCodeActionQuickFix = _.DiagnosticHint
279 -_.BugabingaCodeActionRefactor = _.DiagnosticInfo
165 +-- messages
166 +_.ErrorMsg { fg = P.error }
167 +_.WarningMsg { fg = P.warning, bold = true }
168 +_.Added { fg = P.content_focus }
169 +_.OkMsg = _.Added
170 +_.Removed { fg = P.error }
171 +_.Changed { fg = P.content_important_local }
172 +_.NvimInternalError { fg = P.error, bg = P.content_backdrop }
174 +-- diff
175 +_.DiffAdd = _.Added
176 +_.DiffDelete { fg = P.content_focus, strikethrough = true }
177 +_.DiffChange { fg = P.content_important_global }
178 +_.DiffText { fg = P.content_normal, bg = P.content_unfocus }
180 +-- spelling
181 +_.SpellBad { fg = P.error, undercurl = true }
182 +_.SpellCap = _.SpellBad
183 +_.SpellLocal = _.SpellBad
184 +_.SpellRare = _.SpellBad
186 +-- misc
187 +_.Comment { fg = P.content_important_global, bold = true, italic = true }
188 +_.NotifyBackground = _.NormalUi
189 +_.CycleBufferFileName { fg = P.ui_accent, bold = true }
190 +_.CycleBufferIcon { fg = P.ui_minor }
191 +_.TextYankPost { fg = P.content_backdrop, bg = P.ui_important_local }
192 +_.SnippetTabstop { bg = P.content_unfocus, underline = true }
193 +_.RedrawDebugClear { fg = P.content_backdrop, bg = P.ui_backdrop }
194 +_.RedrawDebugComposed { fg = P.content_backdrop, bg = P.ui_unfocus }
195 +_.RedrawDebugRecompose { fg = P.content_backdrop, bg = P.error }
197 +-- bugabinga code actions
198 +_.BugabingaCodeActionFixAll = _.DiagnosticWarn
199 +_.BugabingaCodeActionQuickFix = _.DiagnosticHint
200 +_.BugabingaCodeActionRefactor = _.DiagnosticInfo
280 201 _.BugabingaCodeActionRefactorExtract = _.DiagnosticInfo
281 -_.BugabingaCodeActionRefactorMove = _.DiagnosticInfo
282 -_.BugabingaCodeActionSource = _.DiagnosticHint
283 -_.BugabingaCodeActionSourceImports = _.DiagnosticHint
284 -_.BugabingaCodeActionDefault = _.DiagnosticHint
202 +_.BugabingaCodeActionRefactorMove = _.DiagnosticInfo
203 +_.BugabingaCodeActionSource = _.DiagnosticHint
204 +_.BugabingaCodeActionSourceImports = _.DiagnosticHint
205 +_.BugabingaCodeActionDefault = _.DiagnosticHint
286 -_.DbgViewerKind = _.Title
287 -_.DbgViewerTime = _.Comment
288 -_.DbgViewerMessage = _.Normal
289 -_.DbgViewerLocation = _.Comment
290 -_.DbgViewerFilter = _.Search
291 -_.DbgViewerKindIcon = _.DiagnosticInfo
207 +-- bugabinga debug viewer
208 +_.DbgViewerKind = _.Title
209 +_.DbgViewerTime = _.Comment
210 +_.DbgViewerMessage = _.Normal
211 +_.DbgViewerLocation = _.Comment
212 +_.DbgViewerFilter = _.Search
213 +_.DbgViewerKindIcon = _.DiagnosticInfo
215 +-- lsp
293 216 _.LspReferenceText { underline = true }
294 217 _.LspReferenceRead = _.LspReferenceText
295 218 _.LspReferenceWrite = _.LspReferenceText
296 -_.LspInlayHint { fg = content_minor, bg = _.Normal.bg }
219 +_.LspInlayHint { fg = P.content_minor, bg = _.Normal.bg }
297 220 _.LspSignatureActiveParameter = _.PmenuSel
299 -_.MiniHipatternsFixme { fg = ui_backdrop, bg = _.DiagnosticError.fg, bold = true, underline = true }
300 -_.MiniHipatternsHack { fg = ui_backdrop, bg = _.DiagnosticWarn.fg, bold = true, underline = true }
301 -_.MiniHipatternsTodo { fg = ui_backdrop, bg = _.DiagnosticHint.fg, bold = true, underline = true }
302 -_.MiniHipatternsNote { fg = ui_backdrop, bg = _.DiagnosticInfo.fg, bold = true, underline = true }
222 +-- mini.hipatterns
223 +_.MiniHipatternsFixme { fg = P.ui_backdrop, bg = _.DiagnosticError.fg, bold = true, underline = true }
224 +_.MiniHipatternsHack { fg = P.ui_backdrop, bg = _.DiagnosticWarn.fg, bold = true, underline = true }
225 +_.MiniHipatternsTodo { fg = P.ui_backdrop, bg = _.DiagnosticHint.fg, bold = true, underline = true }
226 +_.MiniHipatternsNote { fg = P.ui_backdrop, bg = _.DiagnosticInfo.fg, bold = true, underline = true }
228 +-- syntax
229 +_.String { fg = P.content_focus, italic = true }
230 +_.Constant = _.String
231 +_.Character = _.String
232 +_.Number = _.String
233 +_.Boolean = _.String
234 +_.Float = _.String
235 +_.Identifier { fg = _.Normal.fg }
236 +_.Function { fg = _.Normal.fg }
237 +_.FunctionDeclaration { fg = _.Function.fg, underline = true }
238 +_.Parameter { fg = P.content_important_local, bold = true }
239 +_.MutableVariable = { fg = _.Parameter.fg, underline = true }
240 +_.Type { fg = _.Identifier.fg }
241 +_.Delimiter { fg = P.content_minor }
243 +_.Statement { fg = P.content_minor }
244 +_.Conditional = _.Statement
245 +_.Repeat = _.Statement
246 +_.Label = _.Statement
247 +_.Operator = _.Statement
248 +_.Keyword = _.Statement
249 +_.Exception = _.Statement
250 +_.StorageClass = _.Statement
251 +_.Structure = _.Statement
252 +_.Typedef = _.Statement
254 +_.PreProc { fg = P.content_important_global, bold = true }
255 +_.Include = _.PreProc
256 +_.Define = _.PreProc
257 +_.Macro = _.PreProc
258 +_.PreCondit = _.PreProc
260 +_.Special { fg = P.content_important_global, bold = true }
261 +_.SpecialChar = _.Special
262 +_.Tag = _.Special
263 +_.SpecialComment = _.Special
265 +_.Underlined { underline = true }
266 +_.Bold { bold = true }
267 +_.Italic { italic = true }
268 +_.Ignore { fg = _.Normal.bg }
269 +_.Error { fg = P.error }
270 +_.Todo { fg = P.content_important_global, bold = true, underdouble = true }
272 +-- treesitter
304 273 _['@attribute'] = _.Keyword
305 274 _['@boolean'] = _.Boolean
306 275 _['@character'] = _.Character
350 319 _['@variable'] = _.Identifier
351 320 _['@variable.parameter'] = _.Parameter
353 -_['@markup.raw.block'] { fg = content_normal }
354 -_['@markup.raw.block.markdown'] { fg = ui_normal }
355 -_['@markup.raw.block.vimdoc'] { fg = ui_normal }
322 +_['@markup.raw.block'] { fg = P.content_normal }
323 +_['@markup.raw.block.markdown'] { fg = P.ui_normal }
324 +_['@markup.raw.block.vimdoc'] { fg = P.ui_normal }
326 +-- lsp semantic tokens
357 327 _['@lsp.type.class'] = _['@type']
358 328 _['@lsp.type.decorator'] = _['@function']
359 329 _['@lsp.type.enum'] = _['@type']
385 355 return function ()
386 - local namespace = 0
387 356 for name, group in pairs( _.groups ) do
388 357 if group.link then
389 - vim.api.nvim_set_hl( namespace, name, { link = group.link, default = group.default } )
358 + vim.api.nvim_set_hl( 0, name, { link = group.link, default = group.default } )
391 360 local opts = {}
392 - -- map fg/bg to ctermfg/ctermbg
393 - if group.fg then opts.ctermfg = group.fg end
394 - if group.bg then opts.ctermbg = group.bg end
395 - -- mirror boolean attrs to cterm table
361 + if group.fg then opts.ctermfg = group.fg end
362 + if group.bg then opts.ctermbg = group.bg end
396 363 local ct = {}
397 364 for attr in pairs( cterm_attrs ) do
398 365 if group[attr] then ct[attr] = true end
400 367 if next( ct ) then opts.cterm = ct end
401 - -- carry over everything else
402 368 if group.blend then opts.blend = group.blend end
403 369 if group.default then opts.default = group.default end
404 370 if group.force then opts.force = group.force end
405 - vim.api.nvim_set_hl( namespace, name, opts )
371 + vim.api.nvim_set_hl( 0, name, opts )