diff --git a/.github/darkbox.png b/.github/darkbox.png deleted file mode 100644 index 751ef5c..0000000 Binary files a/.github/darkbox.png and /dev/null differ diff --git a/.github/screenshot.png b/.github/screenshot.png deleted file mode 100644 index c834514..0000000 Binary files a/.github/screenshot.png and /dev/null differ diff --git a/.github/screenshot_classic.png b/.github/screenshot_classic.png new file mode 100644 index 0000000..abb9b54 Binary files /dev/null and b/.github/screenshot_classic.png differ diff --git a/.github/screenshot_dim.png b/.github/screenshot_dim.png new file mode 100644 index 0000000..6985782 Binary files /dev/null and b/.github/screenshot_dim.png differ diff --git a/.github/screenshot_retro.png b/.github/screenshot_retro.png new file mode 100644 index 0000000..3e936d2 Binary files /dev/null and b/.github/screenshot_retro.png differ diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..a818b2b --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,25 @@ +on: + push: + branches: + - main +name: docs + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: panvimdoc + uses: kdheepak/panvimdoc@main + with: + vimdoc: gruvbox.nvim + version: "Neovim >= 0.8.0" + demojify: true + treesitter: true + - name: Push changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "auto-generate vimdoc" + commit_user_name: "github-actions[bot]" + commit_user_email: "github-actions[bot]@users.noreply.github.com" + commit_author: "github-actions[bot] " diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d0873f1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +--- +on: [push, pull_request] +name: default + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + nvim-versions: ["stable", "nightly"] + name: test + steps: + - name: checkout + uses: actions/checkout@v3 + + - uses: rhysd/action-setup-vim@v1 + with: + neovim: true + version: ${{ matrix.nvim-versions }} + + - name: run tests + run: make test + env: + PLENARY_DIR: vendor/plenary.nvim diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..43d9f81 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +TESTS_INIT=tests/init.lua +TESTS_DIR=tests/ + +.PHONY: test + +test: + @nvim \ + --headless \ + --noplugin \ + -u ${TESTS_INIT} \ + -c "PlenaryBustedDirectory ${TESTS_DIR} { minimal_init = '${TESTS_INIT}' }" diff --git a/README.md b/README.md index 2e47e2a..db229a1 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,17 @@ A pure-black refresh of the retro-groove aesthetic for modern displays. Darkbox - Retro-groove inspired color palette with modern refinements - Built-in support for tree-sitter +## 📸 Screenshots + +### Classic +![Screenshot](.github/screenshot_classic.png) + +### Retro +![Screenshot](.github/screenshot_retro.png) + +### Dim +![Screenshot](.github/screenshot_dim.png) + ## 🚀 Installation ### Using [lazy.nvim](https://github.com/folke/lazy.nvim) @@ -25,9 +36,54 @@ return { } ``` -## 📸 Screenshot +## ✏️ Configuration -![Screenshot](.github/screenshot.png) +Additional settings for darkbox are available: +```lua +-- Default options: +require("darkbox").setup({ + terminal_colors = true, -- add neovim terminal colors + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "retro", "dim" or empty string for classic + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, +}) +vim.cmd("colorscheme darkbox") +``` + +**VERY IMPORTANT**: Make sure to call setup() **BEFORE** calling the colorscheme command, to use your custom configs + +## 🔧 Overrides + +### Palette + +You can specify your own palette colors. For example: + +```lua +require("darkbox").setup({ + palette_overrides = { + base_red = "#991900", + } +}) +vim.cmd("colorscheme darkbox") +``` ## 🤝 Contributing diff --git a/lua/darkbox.lua b/lua/darkbox.lua index 5f811fa..2ebed49 100644 --- a/lua/darkbox.lua +++ b/lua/darkbox.lua @@ -1,418 +1,1204 @@ -local M = {} +-- ::::::::: ::: ::::::::: ::: :::::::::::: :::::::: ::: ::: +-- :+: :+: :+: :+: :+: :+::+: :+: :+: :+::+: :+::+: :+: +-- +:+ +:+ +:+ +:+ +:+ +:++:+ +:+ +:+ +:++:+ +:+ +:+ +:+ +-- +#+ +:++#++:++#++:+#++:++#: +#++:++ +#++:++#+ +#+ +:+ +#++:+ +-- +#+ +#++#+ +#++#+ +#++#+ +#+ +#+ +#++#+ +#+ +#+ +#+ +-- #+# #+##+# #+##+# #+##+# #+# #+# #+##+# #+##+# #+# +-- ######### ### ###### ###### ############ ######## ### ### +-- +-- INSPIRED BY GRUVBOX (https://github.com/morhetz/gruvbox) +-- Could not have been made possible without the gruvbox.nvim project (https://github.com/ellisonleao/gruvbox.nvim) --- Define the color palette -M.colors = { - bg = "#000000", -- Pure black background - fg = "#ebdbb2", -- Main foreground - black = "#000000", - red = "#fb4934", - green = "#b8bb26", - yellow = "#fabd2f", - blue = "#83a598", - purple = "#d3869b", - aqua = "#8ec07c", - orange = "#fe8019", - gray = "#928374", - dim_gray = "#504945", -- Dimmed background elements - bright_gray = "#a89984", -- Brighter gray elements - dim_black = "#3c3836", -- For UI elements needing slight contrast from bg +---@class Darkbox +---@field config DarkboxConfig +---@field palette DarkboxPalette +local Darkbox = {} + +---@alias Contrast "classic" | "dim" | "" + +---@class ItalicConfig +---@field strings boolean +---@field comments boolean +---@field operators boolean +---@field folds boolean +---@field emphasis boolean + +---@class HighlightDefinition +---@field fg string? +---@field bg string? +---@field sp string? +---@field blend integer? +---@field bold boolean? +---@field standout boolean? +---@field underline boolean? +---@field undercurl boolean? +---@field underdouble boolean? +---@field underdotted boolean? +---@field strikethrough boolean? +---@field italic boolean? +---@field reverse boolean? +---@field nocombine boolean? + +---@class DarkboxConfig +---@field terminal_colors boolean? +---@field undercurl boolean? +---@field underline boolean? +---@field bold boolean? +---@field italic ItalicConfig? +---@field strikethrough boolean? +---@field contrast Contrast? +---@field invert_selection boolean? +---@field invert_signs boolean? +---@field invert_tabline boolean? +---@field invert_intend_guides boolean? +---@field inverse boolean? +---@field overrides table? +---@field palette_overrides table? +Darkbox.config = { + terminal_colors = true, + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, + contrast = "", + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, } --- Set WinSeparator to black -vim.cmd("hi WinSeparator guifg=#000000") +---@class DarkboxPalette +Darkbox.palette = { + background = "#000000", -- The one true background color :D + background_1 = "#3c3836", + background_2 = "#504945", + background_3 = "#665c54", + background_4 = "#7c6f64", + classic_foreground = "#ebdbb2", + retro_foreground = "#bdae93", + dim_foreground = "#a89984", + foreground_1 = "#bdae93", + foreground_2 = "#d5c4a1", + foreground_3 = "#bdae93", + foreground_4 = "#a89984", + classic_red = "#fb4934", + classic_green = "#b8bb26", + classic_yellow = "#fabd2f", + classic_blue = "#83a598", + classic_purple = "#d3869b", + classic_aqua = "#8ec07c", + classic_orange = "#fe8019", + retro_red = "#cc241d", + retro_green = "#98971a", + retro_yellow = "#d79921", + retro_blue = "#458588", + retro_purple = "#b16286", + retro_aqua = "#689d6a", + retro_orange = "#d65d0e", + dim_red = "#9d0006", + dim_green = "#79740e", + dim_yellow = "#b57614", + dim_blue = "#076678", + dim_purple = "#8f3f71", + dim_aqua = "#427b58", + dim_orange = "#af3a03", + gray = "#928374", +} --- Define all the highlight groups -local function get_groups(colors) - return { - -- Base groups - Normal = { fg = colors.fg, bg = colors.bg }, - NormalFloat = { fg = colors.fg, bg = colors.bg }, - Comment = { fg = colors.gray, italic = true }, - CursorLine = { bg = colors.black }, - CursorLineNr = { fg = colors.yellow }, - LineNr = { fg = colors.gray }, - SignColumn = { bg = colors.bg }, - VertSplit = { fg = colors.bg }, - StatusLine = { fg = colors.fg, bg = colors.black }, - StatusLineNC = { fg = colors.gray, bg = colors.black }, - Visual = { bg = colors.dim_gray }, - IncSearch = { fg = colors.black, bg = colors.orange }, - Search = { fg = colors.black, bg = colors.yellow }, - MatchParen = { bg = colors.dim_gray, bold = true }, - Question = { fg = colors.orange, bold = true }, - ModeMsg = { fg = colors.fg, bold = true }, - NonText = { fg = colors.dim_gray }, - - -- Popup menus - Pmenu = { fg = colors.fg, bg = colors.dim_black }, - PmenuSel = { fg = colors.dim_black, bg = colors.blue, bold = true }, - PmenuSbar = { bg = colors.dim_black }, - PmenuThumb = { bg = colors.dim_gray }, - WildMenu = { fg = colors.blue, bg = colors.dim_black, bold = true }, - - -- Base syntax - Identifier = { fg = colors.blue }, - Function = { fg = colors.green, bold = true }, - Statement = { fg = colors.red }, - Constant = { fg = colors.purple }, - String = { fg = colors.green }, - Special = { fg = colors.orange }, - PreProc = { fg = colors.aqua }, - Type = { fg = colors.yellow }, - Directory = { fg = colors.green, bold = true }, - Title = { fg = colors.green, bold = true }, - - -- Diagnostics - DiagnosticError = { fg = colors.red }, - DiagnosticWarn = { fg = colors.yellow }, - DiagnosticInfo = { fg = colors.blue }, - DiagnosticHint = { fg = colors.aqua }, - DiagnosticUnderlineError = { undercurl = true, sp = colors.red }, - DiagnosticUnderlineWarn = { undercurl = true, sp = colors.yellow }, - DiagnosticUnderlineInfo = { undercurl = true, sp = colors.blue }, - DiagnosticUnderlineHint = { undercurl = true, sp = colors.aqua }, - - -- LSP - LspReferenceText = { bg = colors.dim_black }, - LspReferenceRead = { bg = colors.dim_black }, - LspReferenceWrite = { bg = colors.dim_black }, - LspSignatureActiveParameter = { link = "Search" }, - - -- Git Signs - GitSignsAdd = { fg = colors.green }, - GitSignsChange = { fg = colors.yellow }, - GitSignsDelete = { fg = colors.red }, - - -- Diffs - DiffAdd = { bg = colors.green, fg = colors.black }, - DiffChange = { bg = colors.yellow, fg = colors.black }, - DiffDelete = { bg = colors.red, fg = colors.black }, - DiffText = { bg = colors.blue, fg = colors.black }, - - -- Treesitter groups - -- Misc - ["@comment"] = { fg = colors.gray, italic = true }, - ["@error"] = { fg = colors.red }, - ["@preproc"] = { fg = colors.aqua }, - ["@define"] = { fg = colors.aqua }, - ["@operator"] = { fg = colors.purple }, - - -- Punctuation - ["@punctuation.delimiter"] = { fg = colors.fg }, - ["@punctuation.bracket"] = { fg = colors.fg }, - ["@punctuation.special"] = { fg = colors.blue }, - - -- Literals - ["@string"] = { fg = colors.green, italic = true }, - ["@string.regex"] = { fg = colors.orange }, - ["@string.escape"] = { fg = colors.orange }, - ["@string.special"] = { fg = colors.orange }, - ["@character"] = { fg = colors.purple }, - ["@character.special"] = { fg = colors.purple }, - ["@boolean"] = { fg = colors.purple }, - ["@number"] = { fg = colors.purple }, - ["@float"] = { fg = colors.purple }, - - -- Functions - ["@function"] = { fg = colors.blue }, - ["@function.builtin"] = { fg = colors.aqua }, - ["@function.call"] = { fg = colors.blue }, - ["@function.macro"] = { fg = colors.blue, italic = true }, - ["@method"] = { fg = colors.blue }, - ["@method.call"] = { fg = colors.blue }, - ["@constructor"] = { fg = colors.yellow }, - ["@parameter"] = { fg = colors.fg, italic = true }, - - -- Keywords - ["@keyword"] = { fg = colors.purple }, - ["@keyword.function"] = { fg = colors.purple }, - ["@keyword.operator"] = { fg = colors.purple }, - ["@keyword.return"] = { fg = colors.purple }, - ["@conditional"] = { fg = colors.purple }, - ["@repeat"] = { fg = colors.purple }, - ["@debug"] = { fg = colors.purple }, - ["@label"] = { fg = colors.purple }, - ["@include"] = { fg = colors.purple }, - ["@exception"] = { fg = colors.purple }, - - -- Types - ["@type"] = { fg = colors.yellow }, - ["@type.builtin"] = { fg = colors.orange }, - ["@type.qualifier"] = { fg = colors.purple }, - ["@type.definition"] = { fg = colors.yellow }, - ["@storageclass"] = { fg = colors.orange }, - ["@attribute"] = { fg = colors.aqua }, - ["@field"] = { fg = colors.aqua }, - ["@property"] = { fg = colors.aqua }, - - -- Variables - ["@variable"] = { fg = colors.fg }, - ["@variable.builtin"] = { fg = colors.orange }, - ["@constant"] = { fg = colors.purple }, - ["@constant.builtin"] = { fg = colors.purple }, - ["@constant.macro"] = { fg = colors.purple }, - ["@namespace"] = { fg = colors.yellow }, - ["@symbol"] = { fg = colors.purple }, - - -- Text - ["@text"] = { fg = colors.fg }, - ["@text.strong"] = { bold = true }, - ["@text.emphasis"] = { italic = true }, - ["@text.underline"] = { underline = true }, - ["@text.strike"] = { strikethrough = true }, - ["@text.title"] = { fg = colors.green, bold = true }, - ["@text.literal"] = { fg = colors.green }, - ["@text.uri"] = { fg = colors.blue, underline = true }, - ["@text.math"] = { fg = colors.blue }, - ["@text.environment"] = { fg = colors.purple }, - ["@text.environment.name"] = { fg = colors.yellow }, - ["@text.reference"] = { fg = colors.orange }, - ["@text.todo"] = { fg = colors.bg, bg = colors.yellow }, - ["@text.note"] = { fg = colors.bg, bg = colors.blue }, - ["@text.warning"] = { fg = colors.bg, bg = colors.yellow }, - ["@text.danger"] = { fg = colors.bg, bg = colors.red }, - - -- Tags - ["@tag"] = { fg = colors.purple }, - ["@tag.attribute"] = { fg = colors.aqua }, - ["@tag.delimiter"] = { fg = colors.gray }, - - -- Language specific - -- HTML - ["@tag.html"] = { fg = colors.aqua, bold = true }, - ["@tag.delimiter.html"] = { fg = colors.aqua, bold = true }, - htmlTag = { fg = colors.aqua, bold = true }, - htmlEndTag = { fg = colors.aqua, bold = true }, - htmlTagName = { fg = colors.blue }, - htmlArg = { fg = colors.orange }, - htmlTagN = { fg = colors.fg }, - htmlSpecialTagName = { fg = colors.blue }, - htmlLink = { fg = colors.bright_gray, underline = true }, - htmlSpecialChar = { fg = colors.red }, - htmlBold = { fg = colors.fg, bg = colors.bg, bold = true }, - htmlBoldUnderline = { fg = colors.fg, bg = colors.bg, bold = true, underline = true }, - htmlBoldItalic = { fg = colors.fg, bg = colors.bg, bold = true, italic = true }, - htmlItalic = { fg = colors.fg, bg = colors.bg, italic = true }, - - -- CSS - cssBraces = { fg = colors.blue }, - cssFunctionName = { fg = colors.yellow }, - cssIdentifier = { fg = colors.orange }, - cssClassName = { fg = colors.green }, - cssColor = { fg = colors.blue }, - cssSelectorOp = { fg = colors.blue }, - cssSelectorOp2 = { fg = colors.blue }, - cssImportant = { fg = colors.green }, - cssVendor = { fg = colors.fg }, - cssTextProp = { fg = colors.aqua }, - cssAnimationProp = { fg = colors.aqua }, - cssUIProp = { fg = colors.yellow }, - cssTransformProp = { fg = colors.aqua }, - cssTransitionProp = { fg = colors.aqua }, - cssPrintProp = { fg = colors.aqua }, - cssPositioningProp = { fg = colors.yellow }, - cssBoxProp = { fg = colors.aqua }, - cssFontDescriptorProp = { fg = colors.aqua }, - cssFlexibleBoxProp = { fg = colors.aqua }, - cssBorderOutlineProp = { fg = colors.aqua }, - cssBackgroundProp = { fg = colors.aqua }, - cssMarginProp = { fg = colors.aqua }, - cssListProp = { fg = colors.aqua }, - cssTableProp = { fg = colors.aqua }, - cssFontProp = { fg = colors.aqua }, - cssPaddingProp = { fg = colors.aqua }, - cssDimensionProp = { fg = colors.aqua }, - cssRenderProp = { fg = colors.aqua }, - cssColorProp = { fg = colors.aqua }, - cssGeneratedContentProp = { fg = colors.aqua }, - - -- JavaScript - javaScript = { fg = colors.fg }, - javaScriptBraces = { fg = colors.aqua }, - javaScriptNumber = { fg = colors.purple }, - javaScriptNull = { fg = colors.purple }, - javaScriptFunction = { fg = colors.aqua }, - javaScriptIdentifier = { fg = colors.red }, - javaScriptMember = { fg = colors.blue }, - javaScriptParens = { fg = colors.bright_gray }, - - -- TypeScript - typescriptReserved = { fg = colors.aqua }, - typescriptLabel = { fg = colors.aqua }, - typescriptFuncKeyword = { fg = colors.aqua }, - typescriptIdentifier = { fg = colors.orange }, - typescriptBraces = { fg = colors.aqua }, - typescriptEndColons = { fg = colors.fg }, - typescriptDOMObjects = { fg = colors.fg }, - typescriptAjaxMethods = { fg = colors.fg }, - typescriptLogicSymbols = { fg = colors.fg }, - typescriptGlobalObjects = { fg = colors.fg }, - typescriptParens = { fg = colors.bright_gray }, - typescriptOpSymbols = { fg = colors.bright_gray }, - typescriptHtmlElemProperties = { fg = colors.fg }, - typescriptNull = { fg = colors.purple }, - typescriptInterpolationDelimiter = { fg = colors.aqua }, - - -- Python - pythonBuiltin = { fg = colors.orange }, - pythonBuiltinObj = { fg = colors.orange }, - pythonBuiltinFunc = { fg = colors.orange }, - pythonFunction = { fg = colors.aqua }, - pythonDecorator = { fg = colors.red }, - pythonInclude = { fg = colors.blue }, - pythonImport = { fg = colors.blue }, - pythonRun = { fg = colors.blue }, - pythonCoding = { fg = colors.blue }, - pythonOperator = { fg = colors.red }, - pythonException = { fg = colors.red }, - pythonExceptions = { fg = colors.purple }, - pythonBoolean = { fg = colors.purple }, - pythonDot = { fg = colors.bright_gray }, - pythonConditional = { fg = colors.red }, - pythonRepeat = { fg = colors.red }, - pythonDottedName = { fg = colors.green, bold = true }, - - -- Markdown - markdownItalic = { fg = colors.bright_gray, italic = true }, - markdownBold = { fg = colors.bright_gray, bold = true }, - markdownBoldItalic = { fg = colors.bright_gray, bold = true, italic = true }, - markdownH1 = { fg = colors.green, bold = true }, - markdownH2 = { fg = colors.green, bold = true }, - markdownH3 = { fg = colors.yellow, bold = true }, - markdownH4 = { fg = colors.yellow, bold = true }, - markdownH5 = { fg = colors.yellow }, - markdownH6 = { fg = colors.yellow }, - markdownCode = { fg = colors.aqua }, - markdownCodeBlock = { fg = colors.aqua }, - markdownCodeDelimiter = { fg = colors.aqua }, - markdownBlockquote = { fg = colors.gray }, - markdownListMarker = { fg = colors.gray }, - markdownOrderedListMarker = { fg = colors.gray }, - markdownRule = { fg = colors.gray }, - markdownHeadingRule = { fg = colors.gray }, - markdownUrlDelimiter = { fg = colors.bright_gray }, - markdownLinkDelimiter = { fg = colors.bright_gray }, - markdownLinkTextDelimiter = { fg = colors.bright_gray }, - markdownHeadingDelimiter = { fg = colors.orange }, - markdownUrl = { fg = colors.purple }, - markdownUrlTitleDelimiter = { fg = colors.green }, - markdownLinkText = { fg = colors.gray, underline = true }, - markdownIdDeclaration = { link = "markdownLinkText" }, - - -- Telescope - TelescopeNormal = { fg = colors.fg }, - TelescopeSelection = { fg = colors.orange, bold = true }, - TelescopeSelectionCaret = { fg = colors.red }, - TelescopeMultiSelection = { fg = colors.gray }, - TelescopeBorder = { fg = colors.fg }, - TelescopePromptBorder = { fg = colors.fg }, - TelescopeResultsBorder = { fg = colors.fg }, - TelescopePreviewBorder = { fg = colors.fg }, - TelescopeMatching = { fg = colors.blue }, - TelescopePromptPrefix = { fg = colors.red }, - TelescopePrompt = { fg = colors.fg }, - - -- NvimTree - NvimTreeSymlink = { fg = colors.aqua }, - NvimTreeRootFolder = { fg = colors.purple, bold = true }, - NvimTreeFolderIcon = { fg = colors.blue, bold = true }, - NvimTreeFileIcon = { fg = colors.fg }, - NvimTreeExecFile = { fg = colors.green, bold = true }, - NvimTreeOpenedFile = { fg = colors.red, bold = true }, - NvimTreeSpecialFile = { fg = colors.yellow, bold = true, underline = true }, - NvimTreeImageFile = { fg = colors.purple }, - NvimTreeIndentMarker = { fg = colors.dim_gray }, - NvimTreeGitDirty = { fg = colors.yellow }, - NvimTreeGitStaged = { fg = colors.yellow }, - NvimTreeGitMerge = { fg = colors.purple }, - NvimTreeGitRenamed = { fg = colors.purple }, - NvimTreeGitNew = { fg = colors.yellow }, - NvimTreeGitDeleted = { fg = colors.red }, - NvimTreeWindowPicker = { bg = colors.aqua }, - - -- Netrw - netrwDir = { fg = colors.aqua }, - netrwClassify = { fg = colors.aqua }, - netrwLink = { fg = colors.gray }, - netrwSymLink = { fg = colors.fg }, - netrwExe = { fg = colors.yellow }, - netrwComment = { fg = colors.gray }, - netrwList = { fg = colors.blue }, - netrwHelpCmd = { fg = colors.aqua }, - netrwCmdSep = { fg = colors.bright_gray }, - netrwVersion = { fg = colors.green }, - - -- cmp - CmpItemAbbr = { fg = colors.fg }, - CmpItemAbbrDeprecated = { fg = colors.fg }, - CmpItemAbbrMatch = { fg = colors.blue, bold = true }, - CmpItemAbbrMatchFuzzy = { fg = colors.blue, underline = true }, - CmpItemMenu = { fg = colors.gray }, - CmpItemKindText = { fg = colors.orange }, - CmpItemKindMethod = { fg = colors.blue }, - CmpItemKindFunction = { fg = colors.blue }, - CmpItemKindConstructor = { fg = colors.yellow }, - CmpItemKindField = { fg = colors.blue }, - CmpItemKindVariable = { fg = colors.orange }, - CmpItemKindClass = { fg = colors.yellow }, - CmpItemKindInterface = { fg = colors.yellow }, - CmpItemKindModule = { fg = colors.blue }, - CmpItemKindProperty = { fg = colors.blue }, - CmpItemKindUnit = { fg = colors.blue }, - CmpItemKindValue = { fg = colors.orange }, - CmpItemKindEnum = { fg = colors.yellow }, - CmpItemKindKeyword = { fg = colors.purple }, - CmpItemKindSnippet = { fg = colors.green }, - CmpItemKindColor = { fg = colors.purple }, - CmpItemKindFile = { fg = colors.blue }, - CmpItemKindReference = { fg = colors.purple }, - CmpItemKindFolder = { fg = colors.blue }, - CmpItemKindEnumMember = { fg = colors.aqua }, - CmpItemKindConstant = { fg = colors.orange }, - CmpItemKindStruct = { fg = colors.yellow }, - CmpItemKindEvent = { fg = colors.yellow }, - CmpItemKindOperator = { fg = colors.yellow }, - CmpItemKindTypeParameter = { fg = colors.yellow }, +local function get_colors() + local palette = Darkbox.palette + local config = Darkbox.config + local colors = { + background_1 = palette.background_1, + background_2 = palette.background_2, + background_3 = palette.background_3, + background_4 = palette.background_4, + foreground_1 = palette.foreground_1, + foreground_2 = palette.foreground_2, + foreground_3 = palette.foreground_3, + foreground_4 = palette.foreground_4, } + + if config.contrast == "retro" then + colors.foreground = palette.retro_foreground + colors.red = palette.retro_red + colors.green = palette.retro_green + colors.yellow = palette.retro_yellow + colors.blue = palette.retro_blue + colors.purple = palette.retro_purple + colors.aqua = palette.retro_aqua + colors.orange = palette.retro_orange + colors.gray = palette.gray + elseif config.contrast == "dim" then + colors.foreground = palette.dim_foreground + colors.red = palette.dim_red + colors.green = palette.dim_green + colors.yellow = palette.dim_yellow + colors.blue = palette.dim_blue + colors.purple = palette.dim_purple + colors.aqua = palette.dim_aqua + colors.orange = palette.dim_orange + colors.gray = palette.gray + else -- classic/default + colors.foreground = palette.classic_foreground + colors.red = palette.classic_red + colors.green = palette.classic_green + colors.yellow = palette.classic_yellow + colors.blue = palette.classic_blue + colors.purple = palette.classic_purple + colors.aqua = palette.classic_aqua + colors.orange = palette.classic_orange + colors.gray = palette.gray + end + + -- Apply any user overrides last + for color, hex in pairs(config.palette_overrides) do + colors[color] = hex + end + + return colors end --- Load the colorscheme -function M.load() - -- Clear existing highlights +local function get_groups() + local colors = get_colors() + local config = Darkbox.config + + local groups = { + DarkboxFg0 = { fg = colors.foreground }, + DarkboxFg1 = { fg = colors.foreground_1 }, + DarkboxFg2 = { fg = colors.foreground_2 }, + DarkboxFg3 = { fg = colors.foreground_3 }, + DarkboxFg4 = { fg = colors.foreground_4 }, + DarkboxGray = { fg = colors.gray }, + DarkboxBg0 = { fg = colors.background }, + DarkboxBg1 = { fg = colors.background_1 }, + DarkboxBg2 = { fg = colors.background_2 }, + DarkboxBg3 = { fg = colors.background_3 }, + DarkboxBg4 = { fg = colors.background_4 }, + DarkboxRed = { fg = colors.red }, + DarkboxRedBold = { fg = colors.red, bold = config.bold }, + DarkboxGreen = { fg = colors.green }, + DarkboxGreenBold = { fg = colors.green, bold = config.bold }, + DarkboxYellow = { fg = colors.yellow }, + DarkboxYellowBold = { fg = colors.yellow, bold = config.bold }, + DarkboxBlue = { fg = colors.blue }, + DarkboxBlueBold = { fg = colors.blue, bold = config.bold }, + DarkboxPurple = { fg = colors.purple }, + DarkboxPurpleBold = { fg = colors.purple, bold = config.bold }, + DarkboxAqua = { fg = colors.aqua }, + DarkboxAquaBold = { fg = colors.aqua, bold = config.bold }, + DarkboxOrange = { fg = colors.orange }, + DarkboxOrangeBold = { fg = colors.orange, bold = config.bold }, + DarkboxRedSign = config.transparent_mode and { fg = colors.red, reverse = config.invert_signs } + or { fg = colors.red, bg = colors.background_1, reverse = config.invert_signs }, + DarkboxGreenSign = config.transparent_mode and { fg = colors.green, reverse = config.invert_signs } + or { fg = colors.green, bg = colors.background_1, reverse = config.invert_signs }, + DarkboxYellowSign = config.transparent_mode and { fg = colors.yellow, reverse = config.invert_signs } + or { fg = colors.yellow, bg = colors.background_1, reverse = config.invert_signs }, + DarkboxBlueSign = config.transparent_mode and { fg = colors.blue, reverse = config.invert_signs } + or { fg = colors.blue, bg = colors.background_1, reverse = config.invert_signs }, + DarkboxPurpleSign = config.transparent_mode and { fg = colors.purple, reverse = config.invert_signs } + or { fg = colors.purple, bg = colors.background_1, reverse = config.invert_signs }, + DarkboxAquaSign = config.transparent_mode and { fg = colors.aqua, reverse = config.invert_signs } + or { fg = colors.aqua, bg = colors.background_1, reverse = config.invert_signs }, + DarkboxOrangeSign = config.transparent_mode and { fg = colors.orange, reverse = config.invert_signs } + or { fg = colors.orange, bg = colors.background_1, reverse = config.invert_signs }, + DarkboxRedUnderline = { undercurl = config.undercurl, sp = colors.red }, + DarkboxGreenUnderline = { undercurl = config.undercurl, sp = colors.green }, + DarkboxYellowUnderline = { undercurl = config.undercurl, sp = colors.yellow }, + DarkboxBlueUnderline = { undercurl = config.undercurl, sp = colors.blue }, + DarkboxPurpleUnderline = { undercurl = config.undercurl, sp = colors.purple }, + DarkboxAquaUnderline = { undercurl = config.undercurl, sp = colors.aqua }, + DarkboxOrangeUnderline = { undercurl = config.undercurl, sp = colors.orange }, + Normal = config.transparent_mode and { fg = colors.foreground, bg = nil } + or { fg = colors.foreground, bg = colors.background }, + NormalFloat = config.transparent_mode and { fg = colors.foreground_1, bg = nil } + or { fg = colors.foreground_1, bg = colors.background_1 }, + NormalNC = config.dim_inactive and { fg = colors.foreground_1, bg = colors.background_1 } or { link = "Normal" }, + CursorLine = { bg = colors.background_1 }, + CursorColumn = { link = "CursorLine" }, + TabLineFill = { fg = colors.background_4, bg = colors.background_1, reverse = config.invert_tabline }, + TabLineSel = { fg = colors.green, bg = colors.background_1, reverse = config.invert_tabline }, + TabLine = { link = "TabLineFill" }, + MatchParen = { bg = colors.background_3, bold = config.bold }, + ColorColumn = { bg = colors.background_1 }, + Conceal = { fg = colors.blue }, + CursorLineNr = { fg = colors.yellow, bg = colors.background_1 }, + NonText = { link = "DarkboxBg2" }, + SpecialKey = { link = "DarkboxFg4" }, + Visual = { bg = colors.background_3, reverse = config.invert_selection }, + VisualNOS = { link = "Visual" }, + Search = { fg = colors.yellow, bg = colors.background, reverse = config.inverse }, + IncSearch = { fg = colors.orange, bg = colors.background, reverse = config.inverse }, + CurSearch = { link = "IncSearch" }, + QuickFixLine = { link = "DarkboxPurple" }, + Underlined = { fg = colors.blue, underline = config.underline }, + StatusLine = { fg = colors.background_2, bg = colors.foreground_1, reverse = config.inverse }, + StatusLineNC = { fg = colors.background_1, bg = colors.foreground_4, reverse = config.inverse }, + WinBar = { fg = colors.foreground_4, bg = colors.background }, + WinBarNC = { fg = colors.foreground_3, bg = colors.background_1 }, + WinSeparator = config.transparent_mode and { fg = colors.background_3, bg = nil } + or { fg = colors.background_3, bg = colors.background }, + WildMenu = { fg = colors.blue, bg = colors.background_2, bold = config.bold }, + Directory = { link = "DarkboxGreenBold" }, + Title = { link = "DarkboxGreenBold" }, + ErrorMsg = { fg = colors.background, bg = colors.red, bold = config.bold }, + MoreMsg = { link = "DarkboxYellowBold" }, + ModeMsg = { link = "DarkboxYellowBold" }, + Question = { link = "DarkboxOrangeBold" }, + WarningMsg = { link = "DarkboxRedBold" }, + LineNr = { fg = colors.background_4 }, + SignColumn = config.transparent_mode and { bg = nil } or { bg = colors.background_1 }, + Folded = { fg = colors.gray, bg = colors.background_1, italic = config.italic.folds }, + FoldColumn = config.transparent_mode and { fg = colors.gray, bg = nil } + or { fg = colors.gray, bg = colors.background_1 }, + Cursor = { reverse = config.inverse }, + vCursor = { link = "Cursor" }, + iCursor = { link = "Cursor" }, + lCursor = { link = "Cursor" }, + Special = { link = "DarkboxOrange" }, + Comment = { fg = colors.gray, italic = config.italic.comments }, + Todo = { fg = colors.background, bg = colors.yellow, bold = config.bold, italic = config.italic.comments }, + Done = { fg = colors.orange, bold = config.bold, italic = config.italic.comments }, + Error = { fg = colors.red, bold = config.bold, reverse = config.inverse }, + Statement = { link = "DarkboxRed" }, + Conditional = { link = "DarkboxRed" }, + Repeat = { link = "DarkboxRed" }, + Label = { link = "DarkboxRed" }, + Exception = { link = "DarkboxRed" }, + Operator = { fg = colors.orange, italic = config.italic.operators }, + Keyword = { link = "DarkboxRed" }, + Identifier = { link = "DarkboxBlue" }, + Function = { link = "DarkboxGreenBold" }, + PreProc = { link = "DarkboxAqua" }, + Include = { link = "DarkboxAqua" }, + Define = { link = "DarkboxAqua" }, + Macro = { link = "DarkboxAqua" }, + PreCondit = { link = "DarkboxAqua" }, + Constant = { link = "DarkboxPurple" }, + Character = { link = "DarkboxPurple" }, + String = { fg = colors.green, italic = config.italic.strings }, + Boolean = { link = "DarkboxPurple" }, + Number = { link = "DarkboxPurple" }, + Float = { link = "DarkboxPurple" }, + Type = { link = "DarkboxYellow" }, + StorageClass = { link = "DarkboxOrange" }, + Structure = { link = "DarkboxAqua" }, + Typedef = { link = "DarkboxYellow" }, + Pmenu = { fg = colors.foreground_1, bg = colors.background_2 }, + PmenuSel = { fg = colors.background_2, bg = colors.blue, bold = config.bold }, + PmenuSbar = { bg = colors.background_2 }, + PmenuThumb = { bg = colors.background_4 }, + DiffDelete = { bg = colors.dark_red }, + DiffAdd = { bg = colors.dark_green }, + DiffChange = { bg = colors.dark_aqua }, + DiffText = { bg = colors.yellow, fg = colors.background }, + SpellCap = { link = "DarkboxBlueUnderline" }, + SpellBad = { link = "DarkboxRedUnderline" }, + SpellLocal = { link = "DarkboxAquaUnderline" }, + SpellRare = { link = "DarkboxPurpleUnderline" }, + Whitespace = { fg = colors.background_2 }, + Delimiter = { link = "DarkboxOrange" }, + EndOfBuffer = { link = "NonText" }, + DiagnosticError = { link = "DarkboxRed" }, + DiagnosticSignError = { link = "DarkboxRedSign" }, + DiagnosticUnderlineError = { link = "DarkboxRedUnderline" }, + DiagnosticWarn = { link = "DarkboxYellow" }, + DiagnosticSignWarn = { link = "DarkboxYellowSign" }, + DiagnosticUnderlineWarn = { link = "DarkboxYellowUnderline" }, + DiagnosticInfo = { link = "DarkboxBlue" }, + DiagnosticSignInfo = { link = "DarkboxBlueSign" }, + DiagnosticUnderlineInfo = { link = "DarkboxBlueUnderline" }, + DiagnosticHint = { link = "DarkboxAqua" }, + DiagnosticSignHint = { link = "DarkboxAquaSign" }, + DiagnosticUnderlineHint = { link = "DarkboxAquaUnderline" }, + DiagnosticFloatingError = { link = "DarkboxRed" }, + DiagnosticFloatingWarn = { link = "DarkboxOrange" }, + DiagnosticFloatingInfo = { link = "DarkboxBlue" }, + DiagnosticFloatingHint = { link = "DarkboxAqua" }, + DiagnosticVirtualTextError = { link = "DarkboxRed" }, + DiagnosticVirtualTextWarn = { link = "DarkboxYellow" }, + DiagnosticVirtualTextInfo = { link = "DarkboxBlue" }, + DiagnosticVirtualTextHint = { link = "DarkboxAqua" }, + DiagnosticOk = { link = "DarkboxGreenSign" }, + LspReferenceRead = { link = "DarkboxYellowBold" }, + LspReferenceText = { link = "DarkboxYellowBold" }, + LspReferenceWrite = { link = "DarkboxOrangeBold" }, + LspCodeLens = { link = "DarkboxGray" }, + LspSignatureActiveParameter = { link = "Search" }, + gitcommitSelectedFile = { link = "DarkboxGreen" }, + gitcommitDiscardedFile = { link = "DarkboxRed" }, + GitSignsAdd = { link = "DarkboxGreen" }, + GitSignsChange = { link = "DarkboxOrange" }, + GitSignsDelete = { link = "DarkboxRed" }, + NvimTreeSymlink = { fg = colors.neutral_aqua }, + NvimTreeRootFolder = { fg = colors.neutral_purple, bold = true }, + NvimTreeFolderIcon = { fg = colors.neutral_blue, bold = true }, + NvimTreeFileIcon = { fg = colors.light2 }, + NvimTreeExecFile = { fg = colors.neutral_green, bold = true }, + NvimTreeOpenedFile = { fg = colors.bright_red, bold = true }, + NvimTreeSpecialFile = { fg = colors.neutral_yellow, bold = true, underline = true }, + NvimTreeImageFile = { fg = colors.neutral_purple }, + NvimTreeIndentMarker = { fg = colors.dark3 }, + NvimTreeGitDirty = { fg = colors.neutral_yellow }, + NvimTreeGitStaged = { fg = colors.neutral_yellow }, + NvimTreeGitMerge = { fg = colors.neutral_purple }, + NvimTreeGitRenamed = { fg = colors.neutral_purple }, + NvimTreeGitNew = { fg = colors.neutral_yellow }, + NvimTreeGitDeleted = { fg = colors.neutral_red }, + NvimTreeWindowPicker = { bg = colors.aqua }, + debugPC = { link = "DiffAdd" }, + debugBreakpoint = { link = "DarkboxRedSign" }, + StartifyBracket = { link = "DarkboxFg3" }, + StartifyFile = { link = "DarkboxFg1" }, + StartifyNumber = { link = "DarkboxBlue" }, + StartifyPath = { link = "DarkboxGray" }, + StartifySlash = { link = "DarkboxGray" }, + StartifySection = { link = "DarkboxYellow" }, + StartifySpecial = { link = "DarkboxBg2" }, + StartifyHeader = { link = "DarkboxOrange" }, + StartifyFooter = { link = "DarkboxBg2" }, + StartifyVar = { link = "StartifyPath" }, + StartifySelect = { link = "Title" }, + DirvishPathTail = { link = "DarkboxAqua" }, + DirvishArg = { link = "DarkboxYellow" }, + netrwDir = { link = "DarkboxAqua" }, + netrwClassify = { link = "DarkboxAqua" }, + netrwLink = { link = "DarkboxGray" }, + netrwSymLink = { link = "DarkboxFg1" }, + netrwExe = { link = "DarkboxYellow" }, + netrwComment = { link = "DarkboxGray" }, + netrwList = { link = "DarkboxBlue" }, + netrwHelpCmd = { link = "DarkboxAqua" }, + netrwCmdSep = { link = "DarkboxFg3" }, + netrwVersion = { link = "DarkboxGreen" }, + NERDTreeDir = { link = "DarkboxAqua" }, + NERDTreeDirSlash = { link = "DarkboxAqua" }, + NERDTreeOpenable = { link = "DarkboxOrange" }, + NERDTreeClosable = { link = "DarkboxOrange" }, + NERDTreeFile = { link = "DarkboxFg1" }, + NERDTreeExecFile = { link = "DarkboxYellow" }, + NERDTreeUp = { link = "DarkboxGray" }, + NERDTreeCWD = { link = "DarkboxGreen" }, + NERDTreeHelp = { link = "DarkboxFg1" }, + NERDTreeToggleOn = { link = "DarkboxGreen" }, + NERDTreeToggleOff = { link = "DarkboxRed" }, + CocErrorSign = { link = "DarkboxRedSign" }, + CocWarningSign = { link = "DarkboxOrangeSign" }, + CocInfoSign = { link = "DarkboxBlueSign" }, + CocHintSign = { link = "DarkboxAquaSign" }, + CocErrorFloat = { link = "DarkboxRed" }, + CocWarningFloat = { link = "DarkboxOrange" }, + CocInfoFloat = { link = "DarkboxBlue" }, + CocHintFloat = { link = "DarkboxAqua" }, + CocDiagnosticsError = { link = "DarkboxRed" }, + CocDiagnosticsWarning = { link = "DarkboxOrange" }, + CocDiagnosticsInfo = { link = "DarkboxBlue" }, + CocDiagnosticsHint = { link = "DarkboxAqua" }, + CocSelectedText = { link = "DarkboxRed" }, + CocMenuSel = { link = "PmenuSel" }, + CocCodeLens = { link = "DarkboxGray" }, + CocErrorHighlight = { link = "DarkboxRedUnderline" }, + CocWarningHighlight = { link = "DarkboxOrangeUnderline" }, + CocInfoHighlight = { link = "DarkboxBlueUnderline" }, + CocHintHighlight = { link = "DarkboxAquaUnderline" }, + TelescopeNormal = { link = "DarkboxFg1" }, + TelescopeSelection = { link = "DarkboxOrangeBold" }, + TelescopeSelectionCaret = { link = "DarkboxRed" }, + TelescopeMultiSelection = { link = "DarkboxGray" }, + TelescopeBorder = { link = "TelescopeNormal" }, + TelescopePromptBorder = { link = "TelescopeNormal" }, + TelescopeResultsBorder = { link = "TelescopeNormal" }, + TelescopePreviewBorder = { link = "TelescopeNormal" }, + TelescopeMatching = { link = "DarkboxBlue" }, + TelescopePromptPrefix = { link = "DarkboxRed" }, + TelescopePrompt = { link = "TelescopeNormal" }, + CmpItemAbbr = { link = "DarkboxFg0" }, + CmpItemAbbrDeprecated = { link = "DarkboxFg1" }, + CmpItemAbbrMatch = { link = "DarkboxBlueBold" }, + CmpItemAbbrMatchFuzzy = { link = "DarkboxBlueUnderline" }, + CmpItemMenu = { link = "DarkboxGray" }, + CmpItemKindText = { link = "DarkboxOrange" }, + CmpItemKindVariable = { link = "DarkboxOrange" }, + CmpItemKindMethod = { link = "DarkboxBlue" }, + CmpItemKindFunction = { link = "DarkboxBlue" }, + CmpItemKindConstructor = { link = "DarkboxYellow" }, + CmpItemKindUnit = { link = "DarkboxBlue" }, + CmpItemKindField = { link = "DarkboxBlue" }, + CmpItemKindClass = { link = "DarkboxYellow" }, + CmpItemKindInterface = { link = "DarkboxYellow" }, + CmpItemKindModule = { link = "DarkboxBlue" }, + CmpItemKindProperty = { link = "DarkboxBlue" }, + CmpItemKindValue = { link = "DarkboxOrange" }, + CmpItemKindEnum = { link = "DarkboxYellow" }, + CmpItemKindOperator = { link = "DarkboxYellow" }, + CmpItemKindKeyword = { link = "DarkboxPurple" }, + CmpItemKindEvent = { link = "DarkboxPurple" }, + CmpItemKindReference = { link = "DarkboxPurple" }, + CmpItemKindColor = { link = "DarkboxPurple" }, + CmpItemKindSnippet = { link = "DarkboxGreen" }, + CmpItemKindFile = { link = "DarkboxBlue" }, + CmpItemKindFolder = { link = "DarkboxBlue" }, + CmpItemKindEnumMember = { link = "DarkboxAqua" }, + CmpItemKindConstant = { link = "DarkboxOrange" }, + CmpItemKindStruct = { link = "DarkboxYellow" }, + CmpItemKindTypeParameter = { link = "DarkboxYellow" }, + diffAdded = { link = "DiffAdd" }, + diffRemoved = { link = "DiffDelete" }, + diffChanged = { link = "DiffChange" }, + diffFile = { link = "DarkboxOrange" }, + diffNewFile = { link = "DarkboxYellow" }, + diffOldFile = { link = "DarkboxOrange" }, + diffLine = { link = "DarkboxBlue" }, + diffIndexLine = { link = "diffChanged" }, + NavicIconsFile = { link = "DarkboxBlue" }, + NavicIconsModule = { link = "DarkboxOrange" }, + NavicIconsNamespace = { link = "DarkboxBlue" }, + NavicIconsPackage = { link = "DarkboxAqua" }, + NavicIconsClass = { link = "DarkboxYellow" }, + NavicIconsMethod = { link = "DarkboxBlue" }, + NavicIconsProperty = { link = "DarkboxAqua" }, + NavicIconsField = { link = "DarkboxPurple" }, + NavicIconsConstructor = { link = "DarkboxBlue" }, + NavicIconsEnum = { link = "DarkboxPurple" }, + NavicIconsInterface = { link = "DarkboxGreen" }, + NavicIconsFunction = { link = "DarkboxBlue" }, + NavicIconsVariable = { link = "DarkboxPurple" }, + NavicIconsConstant = { link = "DarkboxOrange" }, + NavicIconsString = { link = "DarkboxGreen" }, + NavicIconsNumber = { link = "DarkboxOrange" }, + NavicIconsBoolean = { link = "DarkboxOrange" }, + NavicIconsArray = { link = "DarkboxOrange" }, + NavicIconsObject = { link = "DarkboxOrange" }, + NavicIconsKey = { link = "DarkboxAqua" }, + NavicIconsNull = { link = "DarkboxOrange" }, + NavicIconsEnumMember = { link = "DarkboxYellow" }, + NavicIconsStruct = { link = "DarkboxPurple" }, + NavicIconsEvent = { link = "DarkboxYellow" }, + NavicIconsOperator = { link = "DarkboxRed" }, + NavicIconsTypeParameter = { link = "DarkboxRed" }, + NavicText = { link = "DarkboxWhite" }, + NavicSeparator = { link = "DarkboxWhite" }, + htmlTag = { link = "DarkboxAquaBold" }, + htmlEndTag = { link = "DarkboxAquaBold" }, + htmlTagName = { link = "DarkboxBlue" }, + htmlArg = { link = "DarkboxOrange" }, + htmlTagN = { link = "DarkboxFg1" }, + htmlSpecialTagName = { link = "DarkboxBlue" }, + htmlLink = { fg = colors.foreground_4, underline = config.underline }, + htmlSpecialChar = { link = "DarkboxRed" }, + htmlBold = { fg = colors.foreground, bg = colors.background, bold = config.bold }, + htmlBoldUnderline = { + fg = colors.foreground, + bg = colors.background, + bold = config.bold, + underline = config.underline, + }, + htmlBoldItalic = { fg = colors.foreground, bg = colors.background, bold = config.bold, italic = true }, + htmlBoldUnderlineItalic = { + fg = colors.foreground, + bg = colors.background, + bold = config.bold, + italic = true, + underline = config.underline, + }, + htmlUnderline = { fg = colors.foreground, bg = colors.background, underline = config.underline }, + htmlUnderlineItalic = { + fg = colors.foreground, + bg = colors.background, + italic = true, + underline = config.underline, + }, + htmlItalic = { fg = colors.foreground, bg = colors.background, italic = true }, + xmlTag = { link = "DarkboxAquaBold" }, + xmlEndTag = { link = "DarkboxAquaBold" }, + xmlTagName = { link = "DarkboxBlue" }, + xmlEqual = { link = "DarkboxBlue" }, + docbkKeyword = { link = "DarkboxAquaBold" }, + xmlDocTypeDecl = { link = "DarkboxGray" }, + xmlDocTypeKeyword = { link = "DarkboxPurple" }, + xmlCdataStart = { link = "DarkboxGray" }, + xmlCdataCdata = { link = "DarkboxPurple" }, + dtdFunction = { link = "DarkboxGray" }, + dtdTagName = { link = "DarkboxPurple" }, + xmlAttrib = { link = "DarkboxOrange" }, + xmlProcessingDelim = { link = "DarkboxGray" }, + dtdParamEntityPunct = { link = "DarkboxGray" }, + dtdParamEntityDPunct = { link = "DarkboxGray" }, + xmlAttribPunct = { link = "DarkboxGray" }, + xmlEntity = { link = "DarkboxRed" }, + xmlEntityPunct = { link = "DarkboxRed" }, + clojureKeyword = { link = "DarkboxBlue" }, + clojureCond = { link = "DarkboxOrange" }, + clojureSpecial = { link = "DarkboxOrange" }, + clojureDefine = { link = "DarkboxOrange" }, + clojureFunc = { link = "DarkboxYellow" }, + clojureRepeat = { link = "DarkboxYellow" }, + clojureCharacter = { link = "DarkboxAqua" }, + clojureStringEscape = { link = "DarkboxAqua" }, + clojureException = { link = "DarkboxRed" }, + clojureRegexp = { link = "DarkboxAqua" }, + clojureRegexpEscape = { link = "DarkboxAqua" }, + clojureRegexpCharClass = { fg = colors.foreground_3, bold = config.bold }, + clojureRegexpMod = { link = "clojureRegexpCharClass" }, + clojureRegexpQuantifier = { link = "clojureRegexpCharClass" }, + clojureParen = { link = "DarkboxFg3" }, + clojureAnonArg = { link = "DarkboxYellow" }, + clojureVariable = { link = "DarkboxBlue" }, + clojureMacro = { link = "DarkboxOrange" }, + clojureMeta = { link = "DarkboxYellow" }, + clojureDeref = { link = "DarkboxYellow" }, + clojureQuote = { link = "DarkboxYellow" }, + clojureUnquote = { link = "DarkboxYellow" }, + cOperator = { link = "DarkboxPurple" }, + cppOperator = { link = "DarkboxPurple" }, + cStructure = { link = "DarkboxOrange" }, + pythonBuiltin = { link = "DarkboxOrange" }, + pythonBuiltinObj = { link = "DarkboxOrange" }, + pythonBuiltinFunc = { link = "DarkboxOrange" }, + pythonFunction = { link = "DarkboxAqua" }, + pythonDecorator = { link = "DarkboxRed" }, + pythonInclude = { link = "DarkboxBlue" }, + pythonImport = { link = "DarkboxBlue" }, + pythonRun = { link = "DarkboxBlue" }, + pythonCoding = { link = "DarkboxBlue" }, + pythonOperator = { link = "DarkboxRed" }, + pythonException = { link = "DarkboxRed" }, + pythonExceptions = { link = "DarkboxPurple" }, + pythonBoolean = { link = "DarkboxPurple" }, + pythonDot = { link = "DarkboxFg3" }, + pythonConditional = { link = "DarkboxRed" }, + pythonRepeat = { link = "DarkboxRed" }, + pythonDottedName = { link = "DarkboxGreenBold" }, + cssBraces = { link = "DarkboxBlue" }, + cssFunctionName = { link = "DarkboxYellow" }, + cssIdentifier = { link = "DarkboxOrange" }, + cssClassName = { link = "DarkboxGreen" }, + cssColor = { link = "DarkboxBlue" }, + cssSelectorOp = { link = "DarkboxBlue" }, + cssSelectorOp2 = { link = "DarkboxBlue" }, + cssImportant = { link = "DarkboxGreen" }, + cssVendor = { link = "DarkboxFg1" }, + cssTextProp = { link = "DarkboxAqua" }, + cssAnimationProp = { link = "DarkboxAqua" }, + cssUIProp = { link = "DarkboxYellow" }, + cssTransformProp = { link = "DarkboxAqua" }, + cssTransitionProp = { link = "DarkboxAqua" }, + cssPrintProp = { link = "DarkboxAqua" }, + cssPositioningProp = { link = "DarkboxYellow" }, + cssBoxProp = { link = "DarkboxAqua" }, + cssFontDescriptorProp = { link = "DarkboxAqua" }, + cssFlexibleBoxProp = { link = "DarkboxAqua" }, + cssBorderOutlineProp = { link = "DarkboxAqua" }, + cssBackgroundProp = { link = "DarkboxAqua" }, + cssMarginProp = { link = "DarkboxAqua" }, + cssListProp = { link = "DarkboxAqua" }, + cssTableProp = { link = "DarkboxAqua" }, + cssFontProp = { link = "DarkboxAqua" }, + cssPaddingProp = { link = "DarkboxAqua" }, + cssDimensionProp = { link = "DarkboxAqua" }, + cssRenderProp = { link = "DarkboxAqua" }, + cssColorProp = { link = "DarkboxAqua" }, + cssGeneratedContentProp = { link = "DarkboxAqua" }, + javaScriptBraces = { link = "DarkboxFg1" }, + javaScriptFunction = { link = "DarkboxAqua" }, + javaScriptIdentifier = { link = "DarkboxRed" }, + javaScriptMember = { link = "DarkboxBlue" }, + javaScriptNumber = { link = "DarkboxPurple" }, + javaScriptNull = { link = "DarkboxPurple" }, + javaScriptParens = { link = "DarkboxFg3" }, + typescriptReserved = { link = "DarkboxAqua" }, + typescriptLabel = { link = "DarkboxAqua" }, + typescriptFuncKeyword = { link = "DarkboxAqua" }, + typescriptIdentifier = { link = "DarkboxOrange" }, + typescriptBraces = { link = "DarkboxFg1" }, + typescriptEndColons = { link = "DarkboxFg1" }, + typescriptDOMObjects = { link = "DarkboxFg1" }, + typescriptAjaxMethods = { link = "DarkboxFg1" }, + typescriptLogicSymbols = { link = "DarkboxFg1" }, + typescriptDocSeeTag = { link = "Comment" }, + typescriptDocParam = { link = "Comment" }, + typescriptDocTags = { link = "vimCommentTitle" }, + typescriptGlobalObjects = { link = "DarkboxFg1" }, + typescriptParens = { link = "DarkboxFg3" }, + typescriptOpSymbols = { link = "DarkboxFg3" }, + typescriptHtmlElemProperties = { link = "DarkboxFg1" }, + typescriptNull = { link = "DarkboxPurple" }, + typescriptInterpolationDelimiter = { link = "DarkboxAqua" }, + purescriptModuleKeyword = { link = "DarkboxAqua" }, + purescriptModuleName = { link = "DarkboxFg1" }, + purescriptWhere = { link = "DarkboxAqua" }, + purescriptDelimiter = { link = "DarkboxFg4" }, + purescriptType = { link = "DarkboxFg1" }, + purescriptImportKeyword = { link = "DarkboxAqua" }, + purescriptHidingKeyword = { link = "DarkboxAqua" }, + purescriptAsKeyword = { link = "DarkboxAqua" }, + purescriptStructure = { link = "DarkboxAqua" }, + purescriptOperator = { link = "DarkboxBlue" }, + purescriptTypeVar = { link = "DarkboxFg1" }, + purescriptConstructor = { link = "DarkboxFg1" }, + purescriptFunction = { link = "DarkboxFg1" }, + purescriptConditional = { link = "DarkboxOrange" }, + purescriptBacktick = { link = "DarkboxOrange" }, + coffeeExtendedOp = { link = "DarkboxFg3" }, + coffeeSpecialOp = { link = "DarkboxFg3" }, + coffeeCurly = { link = "DarkboxOrange" }, + coffeeParen = { link = "DarkboxFg3" }, + coffeeBracket = { link = "DarkboxOrange" }, + rubyStringDelimiter = { link = "DarkboxGreen" }, + rubyInterpolationDelimiter = { link = "DarkboxAqua" }, + rubyDefinedOperator = { link = "rubyKeyword" }, + objcTypeModifier = { link = "DarkboxRed" }, + objcDirective = { link = "DarkboxBlue" }, + goDirective = { link = "DarkboxAqua" }, + goConstants = { link = "DarkboxPurple" }, + goDeclaration = { link = "DarkboxRed" }, + goDeclType = { link = "DarkboxBlue" }, + goBuiltins = { link = "DarkboxOrange" }, + luaIn = { link = "DarkboxRed" }, + luaFunction = { link = "DarkboxAqua" }, + luaTable = { link = "DarkboxOrange" }, + moonSpecialOp = { link = "DarkboxFg3" }, + moonExtendedOp = { link = "DarkboxFg3" }, + moonFunction = { link = "DarkboxFg3" }, + moonObject = { link = "DarkboxYellow" }, + javaAnnotation = { link = "DarkboxBlue" }, + javaDocTags = { link = "DarkboxAqua" }, + javaCommentTitle = { link = "vimCommentTitle" }, + javaParen = { link = "DarkboxFg3" }, + javaParen1 = { link = "DarkboxFg3" }, + javaParen2 = { link = "DarkboxFg3" }, + javaParen3 = { link = "DarkboxFg3" }, + javaParen4 = { link = "DarkboxFg3" }, + javaParen5 = { link = "DarkboxFg3" }, + javaOperator = { link = "DarkboxOrange" }, + javaVarArg = { link = "DarkboxGreen" }, + elixirDocString = { link = "Comment" }, + elixirStringDelimiter = { link = "DarkboxGreen" }, + elixirInterpolationDelimiter = { link = "DarkboxAqua" }, + elixirModuleDeclaration = { link = "DarkboxYellow" }, + scalaNameDefinition = { link = "DarkboxFg1" }, + scalaCaseFollowing = { link = "DarkboxFg1" }, + scalaCapitalWord = { link = "DarkboxFg1" }, + scalaTypeExtension = { link = "DarkboxFg1" }, + scalaKeyword = { link = "DarkboxRed" }, + scalaKeywordModifier = { link = "DarkboxRed" }, + scalaSpecial = { link = "DarkboxAqua" }, + scalaOperator = { link = "DarkboxFg1" }, + scalaTypeDeclaration = { link = "DarkboxYellow" }, + scalaTypeTypePostDeclaration = { link = "DarkboxYellow" }, + scalaInstanceDeclaration = { link = "DarkboxFg1" }, + scalaInterpolation = { link = "DarkboxAqua" }, + markdownItalic = { fg = colors.foreground_3, italic = true }, + markdownBold = { fg = colors.foreground_3, bold = config.bold }, + markdownBoldItalic = { fg = colors.foreground_3, bold = config.bold, italic = true }, + markdownH1 = { link = "DarkboxGreenBold" }, + markdownH2 = { link = "DarkboxGreenBold" }, + markdownH3 = { link = "DarkboxYellowBold" }, + markdownH4 = { link = "DarkboxYellowBold" }, + markdownH5 = { link = "DarkboxYellow" }, + markdownH6 = { link = "DarkboxYellow" }, + markdownCode = { link = "DarkboxAqua" }, + markdownCodeBlock = { link = "DarkboxAqua" }, + markdownCodeDelimiter = { link = "DarkboxAqua" }, + markdownBlockquote = { link = "DarkboxGray" }, + markdownListMarker = { link = "DarkboxGray" }, + markdownOrderedListMarker = { link = "DarkboxGray" }, + markdownRule = { link = "DarkboxGray" }, + markdownHeadingRule = { link = "DarkboxGray" }, + markdownUrlDelimiter = { link = "DarkboxFg3" }, + markdownLinkDelimiter = { link = "DarkboxFg3" }, + markdownLinkTextDelimiter = { link = "DarkboxFg3" }, + markdownHeadingDelimiter = { link = "DarkboxOrange" }, + markdownUrl = { link = "DarkboxPurple" }, + markdownUrlTitleDelimiter = { link = "DarkboxGreen" }, + markdownLinkText = { fg = colors.gray, underline = config.underline }, + markdownIdDeclaration = { link = "markdownLinkText" }, + haskellType = { link = "DarkboxBlue" }, + haskellIdentifier = { link = "DarkboxAqua" }, + haskellSeparator = { link = "DarkboxFg4" }, + haskellDelimiter = { link = "DarkboxOrange" }, + haskellOperators = { link = "DarkboxPurple" }, + haskellBacktick = { link = "DarkboxOrange" }, + haskellStatement = { link = "DarkboxPurple" }, + haskellConditional = { link = "DarkboxPurple" }, + haskellLet = { link = "DarkboxRed" }, + haskellDefault = { link = "DarkboxRed" }, + haskellWhere = { link = "DarkboxRed" }, + haskellBottom = { link = "DarkboxRedBold" }, + haskellImportKeywords = { link = "DarkboxPurpleBold" }, + haskellDeclKeyword = { link = "DarkboxOrange" }, + haskellDecl = { link = "DarkboxOrange" }, + haskellDeriving = { link = "DarkboxPurple" }, + haskellAssocType = { link = "DarkboxAqua" }, + haskellNumber = { link = "DarkboxAqua" }, + haskellPragma = { link = "DarkboxRedBold" }, + haskellTH = { link = "DarkboxAquaBold" }, + haskellForeignKeywords = { link = "DarkboxGreen" }, + haskellKeyword = { link = "DarkboxRed" }, + haskellFloat = { link = "DarkboxAqua" }, + haskellInfix = { link = "DarkboxPurple" }, + haskellQuote = { link = "DarkboxGreenBold" }, + haskellShebang = { link = "DarkboxYellowBold" }, + haskellLiquid = { link = "DarkboxPurpleBold" }, + haskellQuasiQuoted = { link = "DarkboxBlueBold" }, + haskellRecursiveDo = { link = "DarkboxPurple" }, + haskellQuotedType = { link = "DarkboxRed" }, + haskellPreProc = { link = "DarkboxFg4" }, + haskellTypeRoles = { link = "DarkboxRedBold" }, + haskellTypeForall = { link = "DarkboxRed" }, + haskellPatternKeyword = { link = "DarkboxBlue" }, + jsonKeyword = { link = "DarkboxGreen" }, + jsonQuote = { link = "DarkboxGreen" }, + jsonBraces = { link = "DarkboxFg1" }, + jsonString = { link = "DarkboxFg1" }, + mailQuoted1 = { link = "DarkboxAqua" }, + mailQuoted2 = { link = "DarkboxPurple" }, + mailQuoted3 = { link = "DarkboxYellow" }, + mailQuoted4 = { link = "DarkboxGreen" }, + mailQuoted5 = { link = "DarkboxRed" }, + mailQuoted6 = { link = "DarkboxOrange" }, + mailSignature = { link = "Comment" }, + csBraces = { link = "DarkboxFg1" }, + csEndColon = { link = "DarkboxFg1" }, + csLogicSymbols = { link = "DarkboxFg1" }, + csParens = { link = "DarkboxFg3" }, + csOpSymbols = { link = "DarkboxFg3" }, + csInterpolationDelimiter = { link = "DarkboxFg3" }, + csInterpolationAlignDel = { link = "DarkboxAquaBold" }, + csInterpolationFormat = { link = "DarkboxAqua" }, + csInterpolationFormatDel = { link = "DarkboxAquaBold" }, + rustSigil = { link = "DarkboxOrange" }, + rustEscape = { link = "DarkboxAqua" }, + rustStringContinuation = { link = "DarkboxAqua" }, + rustEnum = { link = "DarkboxAqua" }, + rustStructure = { link = "DarkboxAqua" }, + rustModPathSep = { link = "DarkboxFg2" }, + rustCommentLineDoc = { link = "Comment" }, + rustDefault = { link = "DarkboxAqua" }, + ocamlOperator = { link = "DarkboxFg1" }, + ocamlKeyChar = { link = "DarkboxOrange" }, + ocamlArrow = { link = "DarkboxOrange" }, + ocamlInfixOpKeyword = { link = "DarkboxRed" }, + ocamlConstructor = { link = "DarkboxOrange" }, + LspSagaCodeActionTitle = { link = "Title" }, + LspSagaCodeActionBorder = { link = "DarkboxFg1" }, + LspSagaCodeActionContent = { fg = colors.green, bold = config.bold }, + LspSagaLspFinderBorder = { link = "DarkboxFg1" }, + LspSagaAutoPreview = { link = "DarkboxOrange" }, + TargetWord = { fg = colors.blue, bold = config.bold }, + FinderSeparator = { link = "DarkboxAqua" }, + LspSagaDefPreviewBorder = { link = "DarkboxBlue" }, + LspSagaHoverBorder = { link = "DarkboxOrange" }, + LspSagaRenameBorder = { link = "DarkboxBlue" }, + LspSagaDiagnosticSource = { link = "DarkboxOrange" }, + LspSagaDiagnosticBorder = { link = "DarkboxPurple" }, + LspSagaDiagnosticHeader = { link = "DarkboxGreen" }, + LspSagaSignatureHelpBorder = { link = "DarkboxGreen" }, + SagaShadow = { link = "DarkboxBg0" }, + DashboardShortCut = { link = "DarkboxOrange" }, + DashboardHeader = { link = "DarkboxAqua" }, + DashboardCenter = { link = "DarkboxYellow" }, + DashboardFooter = { fg = colors.purple, italic = true }, + MasonHighlight = { link = "DarkboxAqua" }, + MasonHighlightBlock = { fg = colors.background, bg = colors.blue }, + MasonHighlightBlockBold = { fg = colors.background, bg = colors.blue, bold = true }, + MasonHighlightSecondary = { fg = colors.yellow }, + MasonHighlightBlockSecondary = { fg = colors.background, bg = colors.yellow }, + MasonHighlightBlockBoldSecondary = { fg = colors.background, bg = colors.yellow, bold = true }, + MasonHeader = { link = "MasonHighlightBlockBoldSecondary" }, + MasonHeaderSecondary = { link = "MasonHighlightBlockBold" }, + MasonMuted = { fg = colors.foreground_4 }, + MasonMutedBlock = { fg = colors.background, bg = colors.foreground_4 }, + MasonMutedBlockBold = { fg = colors.background, bg = colors.foreground_4, bold = true }, + LspInlayHint = { link = "comment" }, + CarbonFile = { link = "DarkboxFg1" }, + CarbonExe = { link = "DarkboxYellow" }, + CarbonSymlink = { link = "DarkboxAqua" }, + CarbonBrokenSymlink = { link = "DarkboxRed" }, + CarbonIndicator = { link = "DarkboxGray" }, + CarbonDanger = { link = "DarkboxRed" }, + CarbonPending = { link = "DarkboxYellow" }, + NoiceCursor = { link = "TermCursor" }, + NoiceCmdlinePopupBorder = { fg = colors.blue, bg = nil }, + NoiceCmdlineIcon = { link = "NoiceCmdlinePopupBorder" }, + NoiceConfirmBorder = { link = "NoiceCmdlinePopupBorder" }, + NoiceCmdlinePopupBorderSearch = { fg = colors.yellow, bg = nil }, + NoiceCmdlineIconSearch = { link = "NoiceCmdlinePopupBorderSearch" }, + NotifyDEBUGBorder = { link = "DarkboxBlue" }, + NotifyDEBUGIcon = { link = "DarkboxBlue" }, + NotifyDEBUGTitle = { link = "DarkboxBlue" }, + NotifyERRORBorder = { link = "DarkboxRed" }, + NotifyERRORIcon = { link = "DarkboxRed" }, + NotifyERRORTitle = { link = "DarkboxRed" }, + NotifyINFOBorder = { link = "DarkboxAqua" }, + NotifyINFOIcon = { link = "DarkboxAqua" }, + NotifyINFOTitle = { link = "DarkboxAqua" }, + NotifyTRACEBorder = { link = "DarkboxGreen" }, + NotifyTRACEIcon = { link = "DarkboxGreen" }, + NotifyTRACETitle = { link = "DarkboxGreen" }, + NotifyWARNBorder = { link = "DarkboxYellow" }, + NotifyWARNIcon = { link = "DarkboxYellow" }, + NotifyWARNTitle = { link = "DarkboxYellow" }, + IlluminatedWordText = { link = "LspReferenceText" }, + IlluminatedWordRead = { link = "LspReferenceRead" }, + IlluminatedWordWrite = { link = "LspReferenceWrite" }, + TSRainbowRed = { fg = colors.red }, + TSRainbowOrange = { fg = colors.orange }, + TSRainbowYellow = { fg = colors.yellow }, + TSRainbowGreen = { fg = colors.green }, + TSRainbowBlue = { fg = colors.blue }, + TSRainbowViolet = { fg = colors.purple }, + TSRainbowCyan = { fg = colors.aqua }, + RainbowDelimiterRed = { fg = colors.red }, + RainbowDelimiterOrange = { fg = colors.orange }, + RainbowDelimiterYellow = { fg = colors.yellow }, + RainbowDelimiterGreen = { fg = colors.green }, + RainbowDelimiterBlue = { fg = colors.blue }, + RainbowDelimiterViolet = { fg = colors.purple }, + RainbowDelimiterCyan = { fg = colors.aqua }, + DapBreakpointSymbol = { fg = colors.red, bg = colors.background_1 }, + DapStoppedSymbol = { fg = colors.green, bg = colors.background_1 }, + DapUIBreakpointsCurrentLine = { link = "DarkboxYellow" }, + DapUIBreakpointsDisabledLine = { link = "DarkboxGray" }, + DapUIBreakpointsInfo = { link = "DarkboxAqua" }, + DapUIBreakpointsLine = { link = "DarkboxYellow" }, + DapUIBreakpointsPath = { link = "DarkboxBlue" }, + DapUICurrentFrameName = { link = "DarkboxPurple" }, + DapUIDecoration = { link = "DarkboxPurple" }, + DapUIEndofBuffer = { link = "EndOfBuffer" }, + DapUIFloatBorder = { link = "DarkboxAqua" }, + DapUILineNumber = { link = "DarkboxYellow" }, + DapUIModifiedValue = { link = "DarkboxRed" }, + DapUIPlayPause = { fg = colors.green, bg = colors.background_1 }, + DapUIRestart = { fg = colors.green, bg = colors.background_1 }, + DapUIScope = { link = "DarkboxBlue" }, + DapUISource = { link = "DarkboxFg1" }, + DapUIStepBack = { fg = colors.blue, bg = colors.background_1 }, + DapUIStepInto = { fg = colors.blue, bg = colors.background_1 }, + DapUIStepOut = { fg = colors.blue, bg = colors.background_1 }, + DapUIStepOver = { fg = colors.blue, bg = colors.background_1 }, + DapUIStop = { fg = colors.red, bg = colors.background_1 }, + DapUIStoppedThread = { link = "DarkboxBlue" }, + DapUIThread = { link = "DarkboxBlue" }, + DapUIType = { link = "DarkboxOrange" }, + DapUIUnavailable = { link = "DarkboxGray" }, + DapUIWatchesEmpty = { link = "DarkboxGray" }, + DapUIWatchesError = { link = "DarkboxRed" }, + DapUIWatchesValue = { link = "DarkboxYellow" }, + DapUIWinSelect = { link = "DarkboxYellow" }, + NeogitDiffDelete = { link = "DiffDelete" }, + NeogitDiffAdd = { link = "DiffAdd" }, + NeogitHunkHeader = { link = "WinBar" }, + NeogitHunkHeaderHighlight = { link = "WinBarNC" }, + DiffviewStatusModified = { link = "DarkboxGreenBold" }, + DiffviewFilePanelInsertions = { link = "DarkboxGreenBold" }, + DiffviewFilePanelDeletions = { link = "DarkboxRedBold" }, + MiniAnimateCursor = { reverse = true, nocombine = true }, + MiniAnimateNormalFloat = { fg = colors.foreground_1, bg = colors.background_1 }, + MiniClueBorder = { link = "FloatBorder" }, + MiniClueDescGroup = { link = "DiagnosticFloatingWarn" }, + MiniClueDescSingle = { link = "NormalFloat" }, + MiniClueNextKey = { link = "DiagnosticFloatingHint" }, + MiniClueNextKeyWithPostkeys = { link = "DiagnosticFloatingError" }, + MiniClueSeparator = { link = "DiagnosticFloatingInfo" }, + MiniClueTitle = { link = "FloatTitle" }, + MiniCompletionActiveParameter = { underline = true }, + MiniCursorword = { underline = true }, + MiniCursorwordCurrent = { underline = true }, + MiniDepsChangeAdded = { link = "DarkboxGreen" }, + MiniDepsChangeRemoved = { link = "DarkboxRed" }, + MiniDepsHint = { link = "DiagnosticHint" }, + MiniDepsInfo = { link = "DiagnosticInfo" }, + MiniDepsMsgBreaking = { link = "DiagnosticWarn" }, + MiniDepsPlaceholder = { link = "Comment" }, + MiniDepsTitle = { link = "Title" }, + MiniDepsTitleError = { link = "DiffDelete" }, + MiniDepsTitleSame = { link = "DiffChange" }, + MiniDepsTitleUpdate = { link = "DiffAdd" }, + MiniDiffOverAdd = { link = "DiffAdd" }, + MiniDiffOverChange = { link = "DiffText" }, + MiniDiffOverContext = { link = "DiffChange" }, + MiniDiffOverDelete = { link = "DiffDelete" }, + MiniDiffSignAdd = { link = "DarkboxGreen" }, + MiniDiffSignChange = { link = "DarkboxAqua" }, + MiniDiffSignDelete = { link = "DarkboxRed" }, + MiniFilesBorder = { link = "FloatBorder" }, + MiniFilesBorderModified = { link = "DiagnosticFloatingWarn" }, + MiniFilesCursorLine = { bg = colors.background_2 }, + MiniFilesDirectory = { link = "Directory" }, + MiniFilesFile = { link = "DarkboxFg1" }, + MiniFilesNormal = { link = "NormalFloat" }, + MiniFilesTitle = { link = "FloatTitle" }, + MiniFilesTitleFocused = { link = "DarkboxOrangeBold" }, + MiniHipatternsFixme = { fg = colors.background, bg = colors.red, bold = config.bold }, + MiniHipatternsHack = { fg = colors.background, bg = colors.yellow, bold = config.bold }, + MiniHipatternsNote = { fg = colors.background, bg = colors.blue, bold = config.bold }, + MiniHipatternsTodo = { fg = colors.background, bg = colors.aqua, bold = config.bold }, + MiniIconsAzure = { link = "DarkboxBlue" }, + MiniIconsBlue = { link = "DarkboxBlue" }, + MiniIconsCyan = { link = "DarkboxAqua" }, + MiniIconsGreen = { link = "DarkboxGreen" }, + MiniIconsGrey = { link = "DarkboxFg0" }, + MiniIconsOrange = { link = "DarkboxOrange" }, + MiniIconsPurple = { link = "DarkboxPurple" }, + MiniIconsRed = { link = "DarkboxRed" }, + MiniIconsYellow = { link = "DarkboxYellow" }, + MiniIndentscopeSymbol = { link = "DarkboxGray" }, + MiniIndentscopeSymbolOff = { link = "DarkboxYellow" }, + MiniJump = { link = "DarkboxOrangeUnderline" }, + MiniJump2dDim = { link = "DarkboxGray" }, + MiniJump2dSpot = { fg = colors.orange, bold = config.bold, nocombine = true }, + MiniJump2dSpotAhead = { fg = colors.aqua, bg = colors.background, nocombine = true }, + MiniJump2dSpotUnique = { fg = colors.yellow, bold = config.bold, nocombine = true }, + MiniMapNormal = { link = "NormalFloat" }, + MiniMapSymbolCount = { link = "Special" }, + MiniMapSymbolLine = { link = "Title" }, + MiniMapSymbolView = { link = "Delimiter" }, + MiniNotifyBorder = { link = "FloatBorder" }, + MiniNotifyNormal = { link = "NormalFloat" }, + MiniNotifyTitle = { link = "FloatTitle" }, + MiniOperatorsExchangeFrom = { link = "IncSearch" }, + MiniPickBorder = { link = "FloatBorder" }, + MiniPickBorderBusy = { link = "DiagnosticFloatingWarn" }, + MiniPickBorderText = { link = "FloatTitle" }, + MiniPickIconDirectory = { link = "Directory" }, + MiniPickIconFile = { link = "MiniPickNormal" }, + MiniPickHeader = { link = "DiagnosticFloatingHint" }, + MiniPickMatchCurrent = { bg = colors.background_2 }, + MiniPickMatchMarked = { link = "Visual" }, + MiniPickMatchRanges = { link = "DiagnosticFloatingHint" }, + MiniPickNormal = { link = "NormalFloat" }, + MiniPickPreviewLine = { link = "CursorLine" }, + MiniPickPreviewRegion = { link = "IncSearch" }, + MiniPickPrompt = { link = "DiagnosticFloatingInfo" }, + MiniStarterCurrent = { nocombine = true }, + MiniStarterFooter = { link = "DarkboxGray" }, + MiniStarterHeader = { link = "Title" }, + MiniStarterInactive = { link = "Comment" }, + MiniStarterItem = { link = "Normal" }, + MiniStarterItemBullet = { link = "Delimiter" }, + MiniStarterItemPrefix = { link = "WarningMsg" }, + MiniStarterSection = { link = "Delimiter" }, + MiniStarterQuery = { link = "MoreMsg" }, + MiniStatuslineDevinfo = { link = "StatusLine" }, + MiniStatuslineFileinfo = { link = "StatusLine" }, + MiniStatuslineFilename = { link = "StatusLineNC" }, + MiniStatuslineInactive = { link = "StatusLineNC" }, + MiniStatuslineModeCommand = { fg = colors.background, bg = colors.yellow, bold = config.bold }, + MiniStatuslineModeInsert = { fg = colors.background, bg = colors.blue, bold = config.bold }, + MiniStatuslineModeNormal = { fg = colors.background, bg = colors.foreground_1, bold = config.bold }, + MiniStatuslineModeOther = { fg = colors.background, bg = colors.aqua, bold = config.bold }, + MiniStatuslineModeReplace = { fg = colors.background, bg = colors.red, bold = config.bold }, + MiniStatuslineModeVisual = { fg = colors.background, bg = colors.green, bold = config.bold }, + MiniSurround = { link = "IncSearch" }, + MiniTablineCurrent = { + fg = colors.green, + bg = colors.background_1, + bold = config.bold, + reverse = config.invert_tabline, + }, + MiniTablineFill = { link = "TabLineFill" }, + MiniTablineHidden = { fg = colors.background_4, bg = colors.background_1, reverse = config.invert_tabline }, + MiniTablineModifiedCurrent = { + fg = colors.background_1, + bg = colors.green, + bold = config.bold, + reverse = config.invert_tabline, + }, + MiniTablineModifiedHidden = { fg = colors.background_1, bg = colors.background_4, reverse = config.invert_tabline }, + MiniTablineModifiedVisible = { fg = colors.background_1, bg = colors.foreground_1, reverse = config.invert_tabline }, + MiniTablineTabpagesection = { link = "Search" }, + MiniTablineVisible = { fg = colors.foreground_1, bg = colors.background_1, reverse = config.invert_tabline }, + MiniTestEmphasis = { bold = config.bold }, + MiniTestFail = { link = "DarkboxRedBold" }, + MiniTestPass = { link = "DarkboxGreenBold" }, + MiniTrailspace = { bg = colors.red }, + ["@comment"] = { link = "Comment" }, + ["@none"] = { bg = "NONE", fg = "NONE" }, + ["@preproc"] = { link = "PreProc" }, + ["@define"] = { link = "Define" }, + ["@operator"] = { link = "Operator" }, + ["@punctuation.delimiter"] = { link = "Delimiter" }, + ["@punctuation.bracket"] = { link = "Delimiter" }, + ["@punctuation.special"] = { link = "Delimiter" }, + ["@string"] = { link = "String" }, + ["@string.regex"] = { link = "String" }, + ["@string.regexp"] = { link = "String" }, + ["@string.escape"] = { link = "SpecialChar" }, + ["@string.special"] = { link = "SpecialChar" }, + ["@string.special.path"] = { link = "Underlined" }, + ["@string.special.symbol"] = { link = "Identifier" }, + ["@string.special.url"] = { link = "Underlined" }, + ["@character"] = { link = "Character" }, + ["@character.special"] = { link = "SpecialChar" }, + ["@boolean"] = { link = "Boolean" }, + ["@number"] = { link = "Number" }, + ["@number.float"] = { link = "Float" }, + ["@float"] = { link = "Float" }, + ["@function"] = { link = "Function" }, + ["@function.builtin"] = { link = "Special" }, + ["@function.call"] = { link = "Function" }, + ["@function.macro"] = { link = "Macro" }, + ["@function.method"] = { link = "Function" }, + ["@method"] = { link = "Function" }, + ["@method.call"] = { link = "Function" }, + ["@constructor"] = { link = "Special" }, + ["@parameter"] = { link = "Identifier" }, + ["@keyword"] = { link = "Keyword" }, + ["@keyword.conditional"] = { link = "Conditional" }, + ["@keyword.debug"] = { link = "Debug" }, + ["@keyword.directive"] = { link = "PreProc" }, + ["@keyword.directive.define"] = { link = "Define" }, + ["@keyword.exception"] = { link = "Exception" }, + ["@keyword.function"] = { link = "Keyword" }, + ["@keyword.import"] = { link = "Include" }, + ["@keyword.operator"] = { link = "DarkboxRed" }, + ["@keyword.repeat"] = { link = "Repeat" }, + ["@keyword.return"] = { link = "Keyword" }, + ["@keyword.storage"] = { link = "StorageClass" }, + ["@conditional"] = { link = "Conditional" }, + ["@repeat"] = { link = "Repeat" }, + ["@debug"] = { link = "Debug" }, + ["@label"] = { link = "Label" }, + ["@include"] = { link = "Include" }, + ["@exception"] = { link = "Exception" }, + ["@type"] = { link = "Type" }, + ["@type.builtin"] = { link = "Type" }, + ["@type.definition"] = { link = "Typedef" }, + ["@type.qualifier"] = { link = "Type" }, + ["@storageclass"] = { link = "StorageClass" }, + ["@attribute"] = { link = "PreProc" }, + ["@field"] = { link = "Identifier" }, + ["@property"] = { link = "Identifier" }, + ["@variable"] = { link = "DarkboxFg1" }, + ["@variable.builtin"] = { link = "Special" }, + ["@variable.member"] = { link = "Identifier" }, + ["@variable.parameter"] = { link = "Identifier" }, + ["@constant"] = { link = "Constant" }, + ["@constant.builtin"] = { link = "Special" }, + ["@constant.macro"] = { link = "Define" }, + ["@markup"] = { link = "DarkboxFg1" }, + ["@markup.strong"] = { bold = config.bold }, + ["@markup.italic"] = { link = "@text.emphasis" }, + ["@markup.underline"] = { underline = config.underline }, + ["@markup.strikethrough"] = { strikethrough = config.strikethrough }, + ["@markup.heading"] = { link = "Title" }, + ["@markup.raw"] = { link = "String" }, + ["@markup.math"] = { link = "Special" }, + ["@markup.environment"] = { link = "Macro" }, + ["@markup.environment.name"] = { link = "Type" }, + ["@markup.link"] = { link = "Underlined" }, + ["@markup.link.label"] = { link = "SpecialChar" }, + ["@markup.list"] = { link = "Delimiter" }, + ["@markup.list.checked"] = { link = "DarkboxGreen" }, + ["@markup.list.unchecked"] = { link = "DarkboxGray" }, + ["@comment.todo"] = { link = "Todo" }, + ["@comment.note"] = { link = "SpecialComment" }, + ["@comment.warning"] = { link = "WarningMsg" }, + ["@comment.error"] = { link = "ErrorMsg" }, + ["@diff.plus"] = { link = "diffAdded" }, + ["@diff.minus"] = { link = "diffRemoved" }, + ["@diff.delta"] = { link = "diffChanged" }, + ["@module"] = { link = "DarkboxFg1" }, + ["@namespace"] = { link = "DarkboxFg1" }, + ["@symbol"] = { link = "Identifier" }, + ["@text"] = { link = "DarkboxFg1" }, + ["@text.strong"] = { bold = config.bold }, + ["@text.emphasis"] = { italic = config.italic.emphasis }, + ["@text.underline"] = { underline = config.underline }, + ["@text.strike"] = { strikethrough = config.strikethrough }, + ["@text.title"] = { link = "Title" }, + ["@text.literal"] = { link = "String" }, + ["@text.uri"] = { link = "Underlined" }, + ["@text.math"] = { link = "Special" }, + ["@text.environment"] = { link = "Macro" }, + ["@text.environment.name"] = { link = "Type" }, + ["@text.reference"] = { link = "Constant" }, + ["@text.todo"] = { link = "Todo" }, + ["@text.todo.checked"] = { link = "DarkboxGreen" }, + ["@text.todo.unchecked"] = { link = "DarkboxGray" }, + ["@text.note"] = { link = "SpecialComment" }, + ["@text.note.comment"] = { fg = colors.purple, bold = config.bold }, + ["@text.warning"] = { link = "WarningMsg" }, + ["@text.danger"] = { link = "ErrorMsg" }, + ["@text.danger.comment"] = { fg = colors.foreground, bg = colors.red, bold = config.bold }, + ["@text.diff.add"] = { link = "diffAdded" }, + ["@text.diff.delete"] = { link = "diffRemoved" }, + ["@tag"] = { link = "Tag" }, + ["@tag.attribute"] = { link = "Identifier" }, + ["@tag.delimiter"] = { link = "Delimiter" }, + ["@punctuation"] = { link = "Delimiter" }, + ["@macro"] = { link = "Macro" }, + ["@structure"] = { link = "Structure" }, + ["@lsp.type.class"] = { link = "@type" }, + ["@lsp.type.comment"] = { link = "@comment" }, + ["@lsp.type.decorator"] = { link = "@macro" }, + ["@lsp.type.enum"] = { link = "@type" }, + ["@lsp.type.enumMember"] = { link = "@constant" }, + ["@lsp.type.function"] = { link = "@function" }, + ["@lsp.type.interface"] = { link = "@constructor" }, + ["@lsp.type.macro"] = { link = "@macro" }, + ["@lsp.type.method"] = { link = "@method" }, + ["@lsp.type.modifier.java"] = { link = "@keyword.type.java" }, + ["@lsp.type.namespace"] = { link = "@namespace" }, + ["@lsp.type.parameter"] = { link = "@parameter" }, + ["@lsp.type.property"] = { link = "@property" }, + ["@lsp.type.struct"] = { link = "@type" }, + ["@lsp.type.type"] = { link = "@type" }, + ["@lsp.type.typeParameter"] = { link = "@type.definition" }, + ["@lsp.type.variable"] = { link = "@variable" }, + } + + for group, hl in pairs(config.overrides) do + if groups[group] then + -- "link" should not mix with other configs (:h hi-link) + groups[group].link = nil + end + + groups[group] = vim.tbl_extend("force", groups[group] or {}, hl) + end + + return groups +end + +---@param config DarkboxConfig? +Darkbox.setup = function(config) + Darkbox.config = vim.tbl_deep_extend("force", Darkbox.config, config or {}) +end + +--- main load function +Darkbox.load = function() + if vim.version().minor < 8 then + vim.notify_once("darkbox.nvim: you must use neovim 0.8 or higher") + return + end + + -- reset colors if vim.g.colors_name then - vim.cmd("hi clear") + vim.cmd.hi("clear") end - if vim.fn.exists("syntax_on") then - vim.cmd("syntax reset") - end - - -- Set colorscheme name - vim.o.termguicolors = true vim.g.colors_name = "darkbox" + vim.o.termguicolors = true - -- Apply highlight groups - local groups = get_groups(M.colors) + local groups = get_groups() + + -- add highlights for group, settings in pairs(groups) do vim.api.nvim_set_hl(0, group, settings) end - - -- Set terminal colors - vim.g.terminal_color_0 = M.colors.black - vim.g.terminal_color_1 = M.colors.red - vim.g.terminal_color_2 = M.colors.green - vim.g.terminal_color_3 = M.colors.yellow - vim.g.terminal_color_4 = M.colors.blue - vim.g.terminal_color_5 = M.colors.purple - vim.g.terminal_color_6 = M.colors.aqua - vim.g.terminal_color_7 = M.colors.gray - vim.g.terminal_color_8 = M.colors.dim_gray - vim.g.terminal_color_9 = M.colors.red - vim.g.terminal_color_10 = M.colors.green - vim.g.terminal_color_11 = M.colors.yellow - vim.g.terminal_color_12 = M.colors.blue - vim.g.terminal_color_13 = M.colors.purple - vim.g.terminal_color_14 = M.colors.aqua - vim.g.terminal_color_15 = M.colors.bright_gray end -return M +return Darkbox diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..0fd4cb5 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferDouble" +no_call_parentheses = false diff --git a/tests/darkbox/darkbox_spec.lua b/tests/darkbox/darkbox_spec.lua new file mode 100644 index 0000000..792010f --- /dev/null +++ b/tests/darkbox/darkbox_spec.lua @@ -0,0 +1,144 @@ +require("plenary.reload").reload_module("darkbox", true) +local darkbox = require("darkbox") +local default = darkbox.config + +local function clear_term_colors() + for item = 0, 15 do + vim.g["terminal_color_" .. item] = nil + end +end + +describe("tests", function() + it("works with default values", function() + darkbox.setup() + assert.are.same(darkbox.config, default) + end) + + it("works with config overrides", function() + local expected = { + terminal_colors = true, + undercurl = false, + underline = false, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + inverse = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + contrast = "", + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + } + + darkbox.setup({ undercurl = false, underline = false }) + assert.are.same(darkbox.config, expected) + end) + + it("should override a hightlight color", function() + local config = { + overrides = { + Search = { fg = "#ff9900", bg = "#000000" }, + ColorColumn = { bg = "#ff9900" }, + }, + } + + darkbox.setup(config) + darkbox.load() + + local search_group_id = vim.api.nvim_get_hl_id_by_name("Search") + local search_values = { + background = vim.fn.synIDattr(search_group_id, "bg", "gui"), + foreground = vim.fn.synIDattr(search_group_id, "fg", "gui"), + } + + assert.are.same(search_values, { background = "#000000", foreground = "#ff9900" }) + + local color_column_group_id = vim.api.nvim_get_hl_id_by_name("ColorColumn") + local color_column_values = { + background = vim.fn.synIDattr(color_column_group_id, "bg", "gui"), + } + + assert.are.same(color_column_values, { background = "#ff9900" }) + end) + + it("should create new hightlights colors if they dont exist", function() + local config = { + overrides = { + Search = { fg = "#ff9900", bg = "#000000" }, + New = { bg = "#ff9900" }, + }, + } + + darkbox.setup(config) + darkbox.load() + + local search_group_id = vim.api.nvim_get_hl_id_by_name("Search") + local search_values = { + background = vim.fn.synIDattr(search_group_id, "bg", "gui"), + foreground = vim.fn.synIDattr(search_group_id, "fg", "gui"), + } + + assert.are.same(search_values, { background = "#000000", foreground = "#ff9900" }) + + local new_group_id = vim.api.nvim_get_hl_id_by_name("New") + local new_group_values = { + background = vim.fn.synIDattr(new_group_id, "bg", "gui"), + } + + assert.are.same(new_group_values, { background = "#ff9900" }) + end) + + it("should override links", function() + local config = { + overrides = { + TelescopePreviewBorder = { fg = "#990000", bg = nil }, + }, + } + darkbox.setup(config) + darkbox.load() + + local group_id = vim.api.nvim_get_hl_id_by_name("TelescopePreviewBorder") + local values = { + fg = vim.fn.synIDattr(group_id, "fg", "gui"), + } + + local expected = { + fg = "#990000", + } + assert.are.same(expected, values) + end) + + it("should override palette", function() + local config = { + palette_overrides = { + gray = "#ff9900", + }, + } + + darkbox.setup(config) + darkbox.load() + + local group_id = vim.api.nvim_get_hl_id_by_name("Comment") + local values = { + fg = vim.fn.synIDattr(group_id, "fg", "gui"), + } + assert.are.same(values, { fg = "#ff9900" }) + end) + + it("does not set terminal colors when terminal_colors is false", function() + clear_term_colors() + darkbox.setup({ terminal_colors = false }) + darkbox.load() + assert.is_nil(vim.g.terminal_color_0) + end) +end) diff --git a/tests/init.lua b/tests/init.lua new file mode 100644 index 0000000..b4c8c23 --- /dev/null +++ b/tests/init.lua @@ -0,0 +1,11 @@ +local plenary_dir = os.getenv("PLENARY_DIR") or "/tmp/plenary.nvim" +local is_not_a_directory = vim.fn.isdirectory(plenary_dir) == 0 +if is_not_a_directory then + vim.fn.system({ "git", "clone", "https://github.com/nvim-lua/plenary.nvim", plenary_dir }) +end + +vim.opt.rtp:append(".") +vim.opt.rtp:append(plenary_dir) + +vim.cmd("runtime plugin/plenary.vim") +require("plenary.busted")