this repo has no description
at master 15 kB view raw
1local lush = require "lush" 2 3local c = require "wombat_lua.colors" 4 5local s = { 6 none = "none ", -- ok? 7 bold = "bold ", 8 italic = "italic ", 9 underline = "underline ", 10 underlineline = "underlineline ", 11 underdouble = "underdouble ", 12 undercurl = "undercurl ", 13 underdot = "underdot ", 14 underdotted = "underdotted ", 15 underdash = "underdash ", 16 underdashed = "underdashed ", 17 strikethrough = "strikethrough ", 18 altfont = "altfont ", 19 reverse = "reverse ", 20 standout = "standout ", 21 nocombine = "nocombine ", 22} 23 24---@diagnostic disable: undefined-global 25local wombat = lush(function(injected_functions) 26 local sym = injected_functions.sym 27 return { 28 -- General 29 Normal { fg = c.norm, bg = c.main_bg }, 30 Cursor { fg = c.main_bg, bg = c.norm }, 31 Visual { fg = c.none, bg = c.visual_bg }, 32 VisualNOS { fg = c.none, bg = c.bg_very_subtle }, 33 Search { fg = c.search, bg = c.search_bg }, 34 Folded { fg = c.fold, bg = c.fold_bg }, 35 WinSeparator { fg = c.norm_accent, bg = c.bg_accent }, 36 LineNr { fg = c.norm_accent, bg = c.bg_accent, gui = s.none }, 37 CursorLine { fg = c.none, bg = c.bg_very_subtle, gui = s.none }, 38 CursorColumn { fg = c.none, bg = c.bg_very_subtle, gui = s.none }, 39 ColorColumn { fg = c.none, bg = c.error, gui = s.none }, 40 MatchParen { fg = c.match_paren, bg = c.match_paren_bg, gui = s.bold }, 41 Title { fg = c.bright_text, bg = c.none, gui = s.bold }, 42 43 -- Pmenu (and pmenu scrollbar) 44 Pmenu { fg = c.norm, bg = c.bg_accent, gui = s.none }, 45 PmenuSel { fg = c.norm, bg = c.bg_very_subtle, gui = s.bold }, 46 -- PmenuSbar { fg=c.norm, bg=c.bg_subtle, gui = s.none}, 47 -- PmenuThumb { fg=c.norm, bg=c.bg_subtle, gui = s.none}, 48 49 -- Diff 50 DiffAdd { fg = c.none, bg = c.diff_add }, 51 DiffDelete { fg = c.none, bg = c.diff_delete }, 52 DiffChange { fg = c.none, bg = c.diff_change }, 53 DiffText { fg = c.none, bg = c.none, gui = s.underline .. s.bold }, 54 55 VcsignsDiffTextAdd { fg = c.none, bg = c.diff_text_add }, 56 VcsignsDiffTextDelete { fg = c.none, bg = c.diff_text_delete }, 57 -- Unsure why I have to specify the bg here, 58 -- seems the default uses the diff line color? 59 SignAdd { fg = c.sign_add, bg = c.bg_accent, gui = s.none }, 60 SignChange { fg = c.sign_change, bg = c.bg_accent, gui = s.none }, 61 SignChangeDelete { 62 fg = c.sign_change_delete, 63 bg = c.bg_accent, 64 gui = s.none, 65 }, 66 SignDelete { fg = c.sign_delete, bg = c.bg_accent, gui = s.none }, 67 SignDeleteFirstLine { 68 fg = c.sign_delete_first_line, 69 bg = c.bg_accent, 70 gui = s.none, 71 }, 72 73 SignifySignAdd { SignAdd }, 74 SignifySignChange { SignChange }, 75 SignifySignChangeDelete { SignChangeDelete }, 76 SignifySignDelete { SignDelete }, 77 SignifySignDeleteFirstLine { SignDeleteFirstLine }, 78 79 GitGutterAdd { SignAdd }, 80 GitGutterDelete { SignDelete }, 81 GitGutterChange { SignChange }, 82 GitGutterChangeDelete { SignChangeDelete }, 83 84 -- Misc 85 SpecialKey { fg = c.mid_gray, bg = c.none, gui = s.none }, 86 Underlined { fg = c.none, bg = c.none, gui = s.underline .. s.bold }, 87 Ignore { fg = c.main_bg, bg = c.none, gui = s.none }, 88 89 Error { fg = c.error, bg = c.none, gui = s.none }, 90 Warning { fg = c.warning, bg = c.none, gui = s.none }, 91 Hint { fg = c.annotation, bg = c.none, gui = s.none }, 92 Info { fg = c.annotation, bg = c.none, gui = s.none }, 93 94 ErrorMsg { fg = c.error, bg = c.none, gui = s.none }, 95 WarningMsg { fg = c.warning, bg = c.none, gui = s.none }, 96 MoreMsg { fg = c.mid_gray, bg = c.none, gui = s.none }, 97 ModeMsg { MoreMsg }, 98 99 NonText { fg = c.non_text, bg = c.none, gui = s.none }, 100 Note { fg = c.none, bg = c.none, gui = s.bold }, -- 101 102 -- ? 103 SignColumn { fg = c.mid_gray, bg = c.bg_accent, gui = s.none }, 104 FoldColumn { fg = c.mid_gray, bg = c.bg_accent, gui = s.none }, 105 106 -- Syntax - Main groups 107 Statement { fg = c.statement, bg = c.none, gui = s.none }, 108 Keyword { Statement }, 109 Conditional { Statement }, 110 Repeat { Statement }, 111 Label { Statement }, 112 Exception { Statement }, 113 114 Constant { fg = c.constant, bg = c.none, gui = s.none }, 115 Number { Constant }, 116 Boolean { Constant }, 117 Float { Constant }, 118 119 PreProc { Constant }, 120 Include { PreProc }, 121 Define { PreProc }, 122 Macro { PreProc }, 123 PreCondit { PreProc }, 124 125 Identifier { fg = c.identifier, bg = c.none, gui = s.none }, 126 Function { fg = c.func, bg = c.none, gui = s.none }, 127 FunctionCall { fg = c.func, bg = c.none, gui = s.none }, 128 129 Type { fg = c.type, bg = c.none, gui = s.none }, 130 StorageClass { Type }, 131 Structure { Type }, 132 Typedef { Type }, 133 134 Special { fg = c.special, bg = c.none, gui = s.none }, 135 SpecialChar { Special }, 136 Tag { Special }, 137 Delimiter { Special }, 138 SpecialComment { Special }, 139 Debug { Special }, 140 141 String { fg = c.string, bg = c.none }, 142 Character { fg = c.character, bg = c.none }, 143 StringEscape { fg = c.escape, bg = c.none }, 144 DocString { fg = c.docstring, bg = c.none }, 145 146 Comment { fg = c.comment, bg = c.none }, 147 Operator { fg = c.operator, bg = c.none }, 148 Todo { fg = c.main_bg, bg = c.todo }, 149 150 Namespace { fg = c.namespace, bg = c.none }, 151 Attribute { fg = c.attribute, bg = c.none }, 152 153 Noop { fg = c.norm_accent, bg = c.none, gui = s.none }, 154 CocFadeOut { Noop }, 155 156 Annotation { fg = c.annotation, bg = c.none }, 157 LspInlayHint { NonText }, 158 CocInlayHint { NonText }, 159 DiagnosticHint { NonText }, 160 161 DiagnosticSignHint { Hint }, 162 DiagnosticSignInfo { Info }, 163 DiagnosticSignWarn { Warning }, 164 DiagnosticSignError { Error }, 165 DiagnosticHint { Hint }, 166 DiagnosticInfo { Info }, 167 DiagnosticWarn { Warning }, 168 DiagnosticError { Error }, 169 DiagnosticUnnecessary { NonText }, 170 171 -- require("wombat_lua.groups.treesitter").build(Group, c, g, s) 172 173 -- TOSORT 174 WombatGreen { fg = c.type, bg = c.none, gui = s.none }, 175 176 NoiceCmdlineIcon { Normal }, 177 NoiceCmdlinePopupBorder { Normal }, 178 NoiceCmdlineIconSearch { WombatGreen }, 179 NoiceCmdlinePopupBorderSearch { WombatGreen }, 180 181 NormalFloat { fg = c.norm_accent, bg = c.bg_accent }, 182 183 IblIndent { fg = c.bg_more_subtle, bg = c.none, gui = s.none }, 184 IblScope { fg = c.norm_accent, bg = c.none, gui = s.none }, 185 186 BufferLineFill { fg = c.none, bg = c.bg_accent }, 187 BufferLineSeparator { fg = c.bg_accent, bg = c.bg_accent }, 188 BufferLineSeparatorVisible { fg = c.bg_accent, bg = c.main_bg }, 189 BufferLineSeparatorSelected { fg = c.bg_accent, bg = c.main_bg }, 190 191 CopilotChatAnnotation { WinSeparator }, 192 193 -- Treesitter 194 UnknownThing { fg = c.norm, bg = c.unknown }, 195 -- Structured following: 196 -- https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights 197 198 -- Identifiers 199 sym("@variable") { Identifier }, -- various variable names 200 sym("@variable.builtin") { Identifier }, -- built-in variable names (e.g. `this`) 201 sym("@variable.parameter") { Normal }, -- parameters of a function 202 sym("@variable.parameter.builtin") { Normal }, -- special parameters (e.g. `_`, `it`) 203 sym("@variable.member") { Identifier }, -- object and struct fields 204 205 sym("@constant") { Constant }, -- constant identifiers 206 sym("@constant.builtin") { Constant }, -- built-in constant values 207 sym("@constant.macro") { Constant }, -- constants defined by the preprocessor 208 209 sym("@module") { Namespace }, -- modules or namespaces 210 sym("@module.builtin") { Namespace }, -- built-in modules or namespaces 211 sym("@label") { Label }, -- GOTO and other labels (e.g. `label:` in C), including heredoc labels 212 213 -- Literals 214 sym("@string") { String }, -- string literals 215 sym("@string.documentation") { DocString }, -- string documenting code (e.g. Python docstrings) 216 sym("@string.regexp") { String }, -- regular expressions 217 sym("@string.escape") { StringEscape }, -- escape sequences 218 sym("@string.special") { String }, -- other special strings (e.g. dates) 219 sym("@string.special.symbol") { Special }, -- symbols or atoms 220 sym("@string.special.url") { String }, -- URIs (e.g. hyperlinks) 221 sym("@string.special.path") { String }, -- filenames 222 223 sym("@character") { Character }, -- character literals 224 sym("@character.special") { Character }, -- special characters (e.g. wildcards) 225 226 sym("@boolean") { Boolean }, -- boolean literals 227 sym("@number") { Number }, -- numeric literals 228 sym("@number.float") { Float }, -- floating-point number literals 229 230 -- Types 231 sym("@type") { Type }, -- type or class definitions and annotations 232 sym("@type.builtin") { Type }, -- built-in types 233 sym("@type.definition") { Type }, -- identifiers in type definitions (e.g. `typedef <type> <identifier>` in C) 234 235 sym("@attribute") { Attribute }, -- attribute annotations (e.g. Python decorators, Rust lifetimes) 236 sym("@attribute.builtin") { Attribute }, -- builtin annotations (e.g. `@property` in Python) 237 sym("@property") { Identifier }, -- the key in key/value pairs 238 sym("@property.toml") { Type }, 239 sym("@property.jjconfig") { Type }, 240 241 -- Functions 242 sym("@function") { Function }, -- function definitions 243 sym("@function.builtin") { Function }, -- built-in functions 244 sym("@function.call") { FunctionCall }, -- function calls 245 sym("@function.macro") { Function }, -- preprocessor macros 246 247 sym("@function.method") { Function }, -- method definitions 248 sym("@function.method.call") { FunctionCall }, -- method calls 249 250 sym("@constructor") { Function }, -- constructor calls and definitions 251 sym("@operator") { Operator }, -- symbolic operators (e.g. `+` / `*`) 252 253 -- Keywords 254 sym("@keyword") { Keyword }, -- keywords not fitting into specific categories 255 sym("@keyword.coroutine") { Keyword }, -- keywords related to coroutines (e.g. `go` in Go, `async/await` in Python) 256 sym("@keyword.function") { Keyword }, -- keywords that define a function (e.g. `func` in Go, `def` in Python) 257 sym("@keyword.operator") { Keyword }, -- operators that are English words (e.g. `and` / `or`) 258 sym("@keyword.import") { Include }, -- keywords for including or exporting modules (e.g. `import` / `from` in Python) 259 sym("@keyword.type") { Keyword }, -- keywords describing namespaces and composite types (e.g. `struct`, `enum`) 260 sym("@keyword.modifier") { Keyword }, -- keywords modifying other constructs (e.g. `const`, `static`, `public`) 261 sym("@keyword.repeat") { Repeat }, -- keywords related to loops (e.g. `for` / `while`) 262 sym("@keyword.return") { Keyword }, -- keywords like `return` and `yield` 263 sym("@keyword.debug") { Keyword }, -- keywords related to debugging 264 sym("@keyword.exception") { Exception }, -- keywords related to exceptions (e.g. `throw` / `catch`) 265 266 sym("@keyword.conditional") { Conditional }, -- keywords related to conditionals (e.g. `if` / `else`) 267 sym("@keyword.conditional.ternary") { Conditional }, -- ternary operator (e.g. `?` / `:`) 268 269 sym("@keyword.directive") { PreProc }, -- various preprocessor directives & shebangs 270 sym("@keyword.directive.define") { PreProc }, -- preprocessor definition directives 271 272 -- Punctuation 273 sym("@punctuation.delimiter") { Special }, -- delimiters (e.g. `;` / `.` / `,`) 274 sym("@punctuation.bracket") { Special }, -- brackets (e.g. `()` / `{}` / `[]`) 275 sym("@punctuation.special") { Special }, -- special symbols (e.g. `{}` in string interpolation) 276 277 -- Comments 278 sym("@comment") { Comment }, -- line and block comments 279 sym("@comment.documentation") { Comment }, -- comments documenting code 280 281 sym("@comment.error") { Error }, -- error-type comments (e.g. `ERROR`, `FIXME`, `DEPRECATED`) 282 sym("@comment.warning") { Warning }, -- warning-type comments (e.g. `WARNING`, `FIX`, `HACK`) 283 sym("@comment.todo") { Todo }, -- todo-type comments (e.g. `TODO`, `WIP`) 284 sym("@comment.note") { Note }, -- note-type comments (e.g. `NOTE`, `INFO`, `XXX`) 285 286 -- Markup 287 -- Mainly for markup languages. 288 --sym("@markup.strong") { Normal }, -- bold text 289 --sym("@markup.italic") { Normal }, -- italic text 290 --sym("@markup.strikethrough") { Normal }, -- struck-through text 291 --sym("@markup.underline") { Normal }, -- underlined text (only for literal underline markup!) 292 293 Header { fg = c.header, bg = c.none, gui = s.bold }, -- headings, titles (e.g. `#` in Markdown) 294 sym("@markup.heading") { Header }, -- headings, titles (including markers) 295 sym("@markup.heading.1") { Header }, -- top-level heading 296 sym("@markup.heading.2") { Header }, -- section heading 297 sym("@markup.heading.3") { Header }, -- subsection heading 298 sym("@markup.heading.4") { Header }, -- and so on 299 sym("@markup.heading.5") { Header }, -- and so forth 300 sym("@markup.heading.6") { Header }, -- six levels ought to be enough for anybody 301 302 sym("@markup.quote") { String }, -- block quotes 303 sym("@markup.math") { Special }, -- math environments (e.g. `$ ... $` in LaTeX) 304 305 sym("@markup.link") { Operator }, -- text references, footnotes, citations, etc. 306 sym("@markup.link.label") {}, -- link, reference descriptions 307 sym("@markup.link.url") { Special }, -- URL-style links 308 309 sym("@markup.raw") { String }, -- literal or verbatim text (e.g. inline code) 310 sym("@markup.raw.block") { String }, -- literal or verbatim text as a stand-alone block 311 -- -- (use priority 90 for blocks with injections) 312 313 sym("@markup.list") { Operator }, -- list markers 314 sym("@markup.list.checked") { Operator, gui = s.bold }, -- checked todo-style list markers 315 sym("@markup.list.unchecked") { Operator }, -- unchecked todo-style list markers 316 317 sym("@diff.plus") { DiffAdd }, -- added text (for diff files) 318 sym("@diff.minus") { DiffDelete }, -- deleted text (for diff files) 319 sym("@diff.delta") { DiffChange }, -- changed text (for diff files) 320 321 sym("@tag") { Keyword }, -- XML-style tag names (and similar) 322 sym("@tag.builtin") { Keyword }, -- builtin tag names (e.g. HTML5 tags) 323 sym("@tag.attribute") { Attribute }, -- XML-style tag attributes 324 sym("@tag.delimiter") { Delimiter }, -- XML-style tag delimiters 325 326 -- Non-highlighting captures 327 sym("@conceal") {}, -- captures that are only meant to be concealed 328 329 sym("@spell") {}, -- for defining regions to be spellchecked 330 sym("@nospell") {}, -- for defining regions that should NOT be spellchecked 331 } 332end) 333 334return wombat 335 336-- vim: set fdm=marker: