|
| 1 | +" Oscura Light - A light Vim/Neovim colorscheme ported from VS Code |
| 2 | +" Author: Vinit Kumar |
| 3 | +" Created: March 20, 2025 |
| 4 | +" License MIT |
| 5 | + |
| 6 | +" Setup |
| 7 | +set background=light |
| 8 | +hi clear |
| 9 | +if exists("syntax_on") |
| 10 | + syntax reset |
| 11 | +endif |
| 12 | +let g:colors_name = "oscura-light" |
| 13 | + |
| 14 | +" Define colors - Light theme optimized for readability |
| 15 | +let s:bg = "#FFFFFF" |
| 16 | +let s:fg = "#2D3748" |
| 17 | +let s:comment = "#718096" |
| 18 | +let s:keyword = "#2B6CB0" |
| 19 | +let s:function = "#805AD5" |
| 20 | +let s:string = "#38A169" |
| 21 | +let s:number = "#D69E2E" |
| 22 | +let s:constant = "#D69E2E" |
| 23 | +let s:type = "#319795" |
| 24 | +let s:error = "#E53E3E" |
| 25 | +let s:warning = "#DD6B20" |
| 26 | +let s:special = "#4A5568" |
| 27 | +let s:visual = "#E2E8F0" |
| 28 | +let s:cursor = "#2B6CB0" |
| 29 | +let s:selection = "#EDF2F7" |
| 30 | +let s:linenum = "#A0AEC0" |
| 31 | +let s:linenum_act = "#2D3748" |
| 32 | +let s:matchbracket = "#38A169" |
| 33 | +let s:search = "#F6E05E" |
| 34 | +let s:diffadd = "#C6F6D5" |
| 35 | +let s:diffdelete = "#FED7D7" |
| 36 | +let s:diffchange = "#FEF5E7" |
| 37 | +let s:difftext = "#E2E8F0" |
| 38 | +let s:link = "#2B6CB0" |
| 39 | +let s:attr = "#319795" |
| 40 | + |
| 41 | +" Helper function for setting highlight groups |
| 42 | +function! s:Hi(group, fg, bg, attr) |
| 43 | + let l:cmd = "hi " . a:group |
| 44 | + if !empty(a:fg) |
| 45 | + let l:cmd .= " guifg=" . a:fg |
| 46 | + endif |
| 47 | + if !empty(a:bg) |
| 48 | + let l:cmd .= " guibg=" . a:bg |
| 49 | + endif |
| 50 | + if !empty(a:attr) |
| 51 | + let l:cmd .= " gui=" . a:attr . " cterm=" . a:attr |
| 52 | + endif |
| 53 | + execute l:cmd |
| 54 | +endfunction |
| 55 | + |
| 56 | +" Editor highlighting |
| 57 | +call s:Hi("Normal", s:fg, s:bg, "") |
| 58 | +call s:Hi("Cursor", s:bg, s:cursor, "bold") |
| 59 | +" CursorLine set to a subtle background for light mode |
| 60 | +call s:Hi("CursorLine", "", s:selection, "none") |
| 61 | +call s:Hi("LineNr", s:linenum, "", "") |
| 62 | +call s:Hi("CursorLineNr", s:linenum_act, "", "") |
| 63 | +call s:Hi("VertSplit", s:linenum, s:bg, "") |
| 64 | +call s:Hi("StatusLine", s:fg, s:visual, "none") |
| 65 | +call s:Hi("StatusLineNC", s:comment, s:selection, "none") |
| 66 | +call s:Hi("Pmenu", s:fg, s:visual, "") |
| 67 | +call s:Hi("PmenuSel", s:bg, s:function, "") |
| 68 | +call s:Hi("PmenuSbar", "", s:visual, "") |
| 69 | +call s:Hi("PmenuThumb", "", s:selection, "") |
| 70 | +call s:Hi("TabLine", s:comment, s:bg, "none") |
| 71 | +call s:Hi("TabLineFill", s:comment, s:bg, "none") |
| 72 | +call s:Hi("TabLineSel", s:fg, s:bg, "none") |
| 73 | +call s:Hi("Search", s:fg, s:search, "") |
| 74 | +call s:Hi("IncSearch", s:fg, s:search, "") |
| 75 | +call s:Hi("MatchParen", s:bg, s:matchbracket, "") |
| 76 | +call s:Hi("Visual", s:fg, s:visual, "") |
| 77 | +call s:Hi("NonText", s:comment, "", "") |
| 78 | +call s:Hi("Todo", s:function, s:bg, "italic") |
| 79 | +call s:Hi("Underlined", s:link, "", "underline") |
| 80 | +call s:Hi("Error", s:error, "", "") |
| 81 | +call s:Hi("ErrorMsg", s:error, "", "") |
| 82 | +call s:Hi("WarningMsg", s:warning, "", "") |
| 83 | +call s:Hi("SpecialKey", s:special, "", "") |
| 84 | +call s:Hi("Title", s:function, "", "bold") |
| 85 | +call s:Hi("SignColumn", "", s:bg, "") |
| 86 | +call s:Hi("DiffAdd", s:fg, s:diffadd, "") |
| 87 | +call s:Hi("DiffDelete", s:fg, s:diffdelete, "") |
| 88 | +call s:Hi("DiffChange", s:fg, s:diffchange, "") |
| 89 | +call s:Hi("DiffText", s:fg, s:difftext, "") |
| 90 | +call s:Hi("Folded", s:comment, s:selection, "") |
| 91 | +call s:Hi("FoldColumn", s:comment, s:bg, "") |
| 92 | +call s:Hi("Directory", s:function, "", "") |
| 93 | +call s:Hi("SpellBad", s:error, "", "undercurl") |
| 94 | +call s:Hi("SpellCap", s:warning, "", "undercurl") |
| 95 | +call s:Hi("SpellRare", s:warning, "", "undercurl") |
| 96 | +call s:Hi("SpellLocal", s:warning, "", "undercurl") |
| 97 | +call s:Hi("ColorColumn", "", s:selection, "") |
| 98 | +call s:Hi("QuickFixLine", "", s:selection, "none") |
| 99 | +call s:Hi("Conceal", s:comment, s:bg, "") |
| 100 | + |
| 101 | +" Syntax highlighting groups |
| 102 | +call s:Hi("Comment", s:comment, "", "") |
| 103 | +call s:Hi("Constant", s:constant, "", "") |
| 104 | +call s:Hi("String", s:string, "", "") |
| 105 | +call s:Hi("Character", s:string, "", "") |
| 106 | +call s:Hi("Number", s:number, "", "") |
| 107 | +call s:Hi("Boolean", s:constant, "", "") |
| 108 | +call s:Hi("Float", s:number, "", "") |
| 109 | +call s:Hi("Identifier", s:fg, "", "") |
| 110 | +call s:Hi("Function", s:function, "", "") |
| 111 | +call s:Hi("Statement", s:keyword, "", "") |
| 112 | +call s:Hi("Conditional", s:keyword, "", "") |
| 113 | +call s:Hi("Repeat", s:keyword, "", "") |
| 114 | +call s:Hi("Label", s:keyword, "", "") |
| 115 | +call s:Hi("Operator", s:keyword, "", "") |
| 116 | +call s:Hi("Keyword", s:keyword, "", "") |
| 117 | +call s:Hi("Exception", s:keyword, "", "") |
| 118 | +call s:Hi("PreProc", s:keyword, "", "") |
| 119 | +call s:Hi("Include", s:keyword, "", "") |
| 120 | +call s:Hi("Define", s:keyword, "", "") |
| 121 | +call s:Hi("Macro", s:keyword, "", "") |
| 122 | +call s:Hi("PreCondit", s:keyword, "", "") |
| 123 | +call s:Hi("Type", s:type, "", "") |
| 124 | +call s:Hi("StorageClass", s:keyword, "", "") |
| 125 | +call s:Hi("Structure", s:type, "", "") |
| 126 | +call s:Hi("Typedef", s:type, "", "") |
| 127 | +call s:Hi("Special", s:special, "", "") |
| 128 | +call s:Hi("SpecialChar", s:special, "", "") |
| 129 | +call s:Hi("Tag", s:attr, "", "") |
| 130 | +call s:Hi("Delimiter", s:special, "", "") |
| 131 | +call s:Hi("SpecialComment", s:comment, "", "") |
| 132 | +call s:Hi("Debug", s:warning, "", "") |
| 133 | +call s:Hi("WildMenu", s:fg, s:bg, "") |
| 134 | +call s:Hi("NormalFloat", s:fg, s:visual, "") |
| 135 | + |
| 136 | +" HTML |
| 137 | +call s:Hi("htmlTag", s:special, "", "") |
| 138 | +call s:Hi("htmlEndTag", s:special, "", "") |
| 139 | +call s:Hi("htmlTagName", s:function, "", "") |
| 140 | +call s:Hi("htmlArg", s:attr, "", "") |
| 141 | +call s:Hi("htmlTitle", s:fg, "", "") |
| 142 | + |
| 143 | +" CSS |
| 144 | +call s:Hi("cssClassName", s:function, "", "") |
| 145 | +call s:Hi("cssIdentifier", s:function, "", "") |
| 146 | +call s:Hi("cssTagName", s:function, "", "") |
| 147 | +call s:Hi("cssColor", s:constant, "", "") |
| 148 | +call s:Hi("cssBraces", s:special, "", "") |
| 149 | +call s:Hi("cssAttr", s:attr, "", "") |
| 150 | +call s:Hi("cssAttrRegion", s:attr, "", "") |
| 151 | +call s:Hi("cssDefinition", s:attr, "", "") |
| 152 | +call s:Hi("cssVendor", s:attr, "", "") |
| 153 | +call s:Hi("cssImportant", s:attr, "", "") |
| 154 | + |
| 155 | +" JavaScript |
| 156 | +call s:Hi("javaScript", s:fg, "", "") |
| 157 | +call s:Hi("javaScriptBraces", s:special, "", "") |
| 158 | +call s:Hi("javaScriptNumber", s:constant, "", "") |
| 159 | +call s:Hi("javaScriptNull", s:constant, "", "") |
| 160 | +call s:Hi("javaScriptIdentifier", s:keyword, "", "") |
| 161 | +call s:Hi("javaScriptOperator", s:keyword, "", "") |
| 162 | +call s:Hi("javaScriptFunction", s:keyword, "", "") |
| 163 | +call s:Hi("javaScriptRegexpString", s:string, "", "") |
| 164 | +call s:Hi("javaScriptGlobal", s:type, "", "") |
| 165 | +call s:Hi("javaScriptMessage", s:type, "", "") |
| 166 | +call s:Hi("javaScriptThis", s:special, "", "") |
| 167 | + |
| 168 | +" Python |
| 169 | +call s:Hi("pythonBuiltin", s:function, "", "bold") |
| 170 | +call s:Hi("pythonStatement", s:keyword, "", "") |
| 171 | +call s:Hi("pythonConditional", s:keyword, "", "") |
| 172 | +call s:Hi("pythonRepeat", s:keyword, "", "") |
| 173 | +call s:Hi("pythonException", s:keyword, "", "") |
| 174 | +call s:Hi("pythonInclude", s:keyword, "", "") |
| 175 | +call s:Hi("pythonDecorator", s:attr, "", "") |
| 176 | +call s:Hi("pythonFunction", s:function, "", "") |
| 177 | +call s:Hi("pythonClass", s:function, "", "") |
| 178 | +call s:Hi("pythonOperator", s:keyword, "", "") |
| 179 | +call s:Hi("pythonSelf", s:special, "", "") |
| 180 | +call s:Hi("pythonDottedName", s:special, "", "") |
| 181 | +call s:Hi("pythonComment", s:comment, "", "italic") |
| 182 | +call s:Hi("pythonDocstring", s:comment, "", "italic") |
| 183 | +call s:Hi("pythonString", s:string, "", "") |
| 184 | +call s:Hi("pythonQuotes", s:string, "", "") |
| 185 | +call s:Hi("pythonTripleQuotes", s:string, "", "") |
| 186 | + |
| 187 | +" Markdown |
| 188 | +call s:Hi("markdownHeadingDelimiter", s:function, "", "") |
| 189 | +call s:Hi("markdownH1", s:function, "", "bold") |
| 190 | +call s:Hi("markdownH2", s:function, "", "bold") |
| 191 | +call s:Hi("markdownH3", s:function, "", "bold") |
| 192 | +call s:Hi("markdownH4", s:function, "", "bold") |
| 193 | +call s:Hi("markdownH5", s:function, "", "bold") |
| 194 | +call s:Hi("markdownH6", s:function, "", "bold") |
| 195 | +call s:Hi("markdownCode", s:special, "", "") |
| 196 | +call s:Hi("markdownCodeBlock", s:special, "", "") |
| 197 | +call s:Hi("markdownCodeDelimiter", s:special, "", "") |
| 198 | +call s:Hi("markdownBlockquote", s:comment, "", "") |
| 199 | +call s:Hi("markdownListMarker", s:function, "", "") |
| 200 | +call s:Hi("markdownOrderedListMarker", s:function, "", "") |
| 201 | +call s:Hi("markdownRule", s:special, "", "") |
| 202 | +call s:Hi("markdownHeadingRule", s:special, "", "") |
| 203 | +call s:Hi("markdownUrlDelimiter", s:special, "", "") |
| 204 | +call s:Hi("markdownLinkDelimiter", s:special, "", "") |
| 205 | +call s:Hi("markdownLinkTextDelimiter", s:special, "", "") |
| 206 | +call s:Hi("markdownHeadingDelimiter", s:special, "", "") |
| 207 | +call s:Hi("markdownUrl", s:link, "", "") |
| 208 | +call s:Hi("markdownUrlTitleDelimiter", s:string, "", "") |
| 209 | +call s:Hi("markdownLinkText", s:function, "", "underline") |
| 210 | +call s:Hi("markdownIdDeclaration", s:function, "", "") |
| 211 | + |
| 212 | +" JSON |
| 213 | +call s:Hi("jsonKeyword", s:function, "", "") |
| 214 | +call s:Hi("jsonString", s:string, "", "") |
| 215 | +call s:Hi("jsonBoolean", s:constant, "", "") |
| 216 | +call s:Hi("jsonNumber", s:constant, "", "") |
| 217 | +call s:Hi("jsonQuote", s:special, "", "") |
| 218 | +call s:Hi("jsonBraces", s:special, "", "") |
| 219 | +call s:Hi("jsonNull", s:constant, "", "") |
| 220 | + |
| 221 | +" Terminal |
| 222 | +if has("nvim") |
| 223 | + let g:terminal_color_0 = s:bg |
| 224 | + let g:terminal_color_1 = s:error |
| 225 | + let g:terminal_color_2 = s:string |
| 226 | + let g:terminal_color_3 = s:warning |
| 227 | + let g:terminal_color_4 = s:keyword |
| 228 | + let g:terminal_color_5 = s:function |
| 229 | + let g:terminal_color_6 = s:type |
| 230 | + let g:terminal_color_7 = s:fg |
| 231 | + let g:terminal_color_8 = s:comment |
| 232 | + let g:terminal_color_9 = s:error |
| 233 | + let g:terminal_color_10 = s:string |
| 234 | + let g:terminal_color_11 = s:warning |
| 235 | + let g:terminal_color_12 = s:keyword |
| 236 | + let g:terminal_color_13 = s:function |
| 237 | + let g:terminal_color_14 = s:type |
| 238 | + let g:terminal_color_15 = s:fg |
| 239 | +endif |
| 240 | + |
| 241 | +" TreeSitter support (for Neovim) |
| 242 | +if has("nvim") |
| 243 | + " Identifiers |
| 244 | + hi! link @variable Identifier |
| 245 | + hi! link @variable.builtin Special |
| 246 | + hi! link @variable.parameter Special |
| 247 | + hi! link @variable.member Identifier |
| 248 | + hi! link @constant Constant |
| 249 | + hi! link @constant.builtin Special |
| 250 | + hi! link @constant.macro Define |
| 251 | + hi! link @module Type |
| 252 | + hi! link @label Label |
| 253 | + hi! link @symbol Special |
| 254 | + |
| 255 | + " Functions |
| 256 | + hi! link @function Function |
| 257 | + hi! link @function.builtin Special |
| 258 | + hi! link @function.macro Macro |
| 259 | + hi! link @method Function |
| 260 | + hi! link @constructor Function |
| 261 | + hi! link @parameter Special |
| 262 | + |
| 263 | + " Keywords |
| 264 | + hi! link @keyword Keyword |
| 265 | + hi! link @keyword.function Keyword |
| 266 | + hi! link @keyword.operator Operator |
| 267 | + hi! link @keyword.return Keyword |
| 268 | + hi! link @conditional Conditional |
| 269 | + hi! link @repeat Repeat |
| 270 | + hi! link @debug Debug |
| 271 | + hi! link @exception Exception |
| 272 | + hi! link @include Include |
| 273 | + hi! link @define Define |
| 274 | + |
| 275 | + " Types |
| 276 | + hi! link @type Type |
| 277 | + hi! link @type.builtin Type |
| 278 | + hi! link @type.qualifier StorageClass |
| 279 | + hi! link @type.definition Typedef |
| 280 | + hi! link @storageclass StorageClass |
| 281 | + hi! link @namespace Identifier |
| 282 | + hi! link @attribute Special |
| 283 | + hi! link @property Identifier |
| 284 | + hi! link @field Identifier |
| 285 | + |
| 286 | + " Literals |
| 287 | + hi! link @string String |
| 288 | + hi! link @string.regex String |
| 289 | + hi! link @string.escape SpecialChar |
| 290 | + hi! link @string.special SpecialChar |
| 291 | + hi! link @character Character |
| 292 | + hi! link @character.special SpecialChar |
| 293 | + hi! link @boolean Boolean |
| 294 | + hi! link @number Number |
| 295 | + hi! link @float Float |
| 296 | + |
| 297 | + " Markup |
| 298 | + hi! link @text.strong Bold |
| 299 | + hi! link @text.emphasis Italic |
| 300 | + hi! link @text.underline Underlined |
| 301 | + hi! link @text.strike Comment |
| 302 | + hi! link @text.title Title |
| 303 | + hi! link @text.literal String |
| 304 | + hi! link @text.uri Underlined |
| 305 | + hi! link @text.reference Identifier |
| 306 | + hi! link @tag Tag |
| 307 | + hi! link @tag.attribute Label |
| 308 | + hi! link @tag.delimiter Special |
| 309 | + |
| 310 | + " Comments |
| 311 | + hi! link @comment Comment |
| 312 | + hi! link @comment.documentation SpecialComment |
| 313 | + |
| 314 | + " Punctuation |
| 315 | + hi! link @punctuation.delimiter Delimiter |
| 316 | + hi! link @punctuation.bracket Delimiter |
| 317 | + hi! link @punctuation.special Delimiter |
| 318 | + |
| 319 | + " Misc |
| 320 | + hi! link @error Error |
| 321 | + hi! link @danger Error |
| 322 | + hi! link @todo Todo |
| 323 | +endif |
| 324 | + |
| 325 | +" TypeScript/JavaScript Specific |
| 326 | +call s:Hi("typescriptBraces", s:special, "", "") |
| 327 | +call s:Hi("typescriptParens", s:special, "", "") |
| 328 | +call s:Hi("typescriptEndColons", s:special, "", "") |
| 329 | +call s:Hi("typescriptModule", s:keyword, "", "") |
| 330 | +call s:Hi("typescriptImport", s:keyword, "", "") |
| 331 | +call s:Hi("typescriptExport", s:keyword, "", "") |
| 332 | +call s:Hi("typescriptVariable", s:keyword, "", "") |
| 333 | +call s:Hi("typescriptOperator", s:keyword, "", "") |
| 334 | +call s:Hi("typescriptEnumKeyword", s:keyword, "", "") |
| 335 | +call s:Hi("typescriptArrowFunc", s:keyword, "", "") |
| 336 | +call s:Hi("typescriptMethodAccessor", s:keyword, "", "") |
| 337 | +call s:Hi("typescriptAsyncFuncKeyword", s:keyword, "", "") |
| 338 | +call s:Hi("typescriptAwaitKeyword", s:keyword, "", "") |
| 339 | +call s:Hi("typescriptCall", s:special, "", "") |
| 340 | +call s:Hi("typescriptClassName", s:function, "", "") |
| 341 | +call s:Hi("typescriptClassHeritage", s:function, "", "") |
| 342 | +call s:Hi("typescriptInterfaceName", s:function, "", "") |
| 343 | +call s:Hi("typescriptTypeReference", s:function, "", "") |
| 344 | +call s:Hi("typescriptFuncName", s:function, "", "") |
| 345 | +call s:Hi("typescriptMember", s:function, "", "") |
| 346 | +call s:Hi("typescriptObjectLabel", s:fg, "", "") |
| 347 | +call s:Hi("typescriptCall", s:fg, "", "") |
| 348 | +call s:Hi("typescriptBinaryOp", s:keyword, "", "") |
| 349 | +call s:Hi("typescriptUnaryOp", s:keyword, "", "") |
| 350 | +call s:Hi("typescriptAssign", s:keyword, "", "") |
| 351 | +call s:Hi("typescriptConstructSignature", s:keyword, "", "") |
| 352 | +call s:Hi("typescriptFuncType", s:special, "", "") |
| 353 | + |
| 354 | +" String Literals in TypeScript/JavaScript |
| 355 | +call s:Hi("typescriptStringLiteralType", s:attr, "", "") |
| 356 | +call s:Hi("typescriptStringProperty", s:attr, "", "") |
| 357 | +call s:Hi("typescriptObjectPropertyKey", s:attr, "", "") |
| 358 | +call s:Hi("typescriptTemplateLiteral", s:string, "", "") |
| 359 | +call s:Hi("typescriptString", s:string, "", "") |
| 360 | +call s:Hi("typescriptStringS", s:string, "", "") |
| 361 | +call s:Hi("typescriptStringD", s:string, "", "") |
| 362 | +call s:Hi("typescriptStringB", s:string, "", "") |
| 363 | + |
| 364 | +" Next.js Directives |
| 365 | +call s:Hi("typescriptDirective", s:string, "", "") |
| 366 | +call s:Hi("javascriptDirective", s:string, "", "") |
| 367 | + |
| 368 | +" Import/Export Paths |
| 369 | +call s:Hi("typescriptImportPath", s:fg, "", "") |
| 370 | +call s:Hi("typescriptExportPath", s:fg, "", "") |
| 371 | + |
| 372 | +" TSX/JSX Support |
| 373 | +call s:Hi("tsxAttrib", s:attr, "", "") |
| 374 | +call s:Hi("tsxTag", s:special, "", "") |
| 375 | +call s:Hi("tsxTagName", s:function, "", "") |
| 376 | +call s:Hi("tsxCloseTag", s:special, "", "") |
| 377 | +call s:Hi("tsxCloseString", s:special, "", "") |
| 378 | +call s:Hi("tsxAttributeBraces", s:special, "", "") |
| 379 | +call s:Hi("tsxEqual", s:special, "", "") |
| 380 | +call s:Hi("tsxString", s:fg, "", "") |
| 381 | + |
| 382 | +" Template Strings |
| 383 | +call s:Hi("typescriptTemplate", s:string, "", "") |
| 384 | +call s:Hi("typescriptTemplateSubstitution", s:string, "", "") |
| 385 | +call s:Hi("typescriptTemplateSB", s:special, "", "") |
| 386 | + |
| 387 | +" Done! |
0 commit comments