Now standalone plugin

First impl of standalone colorscheme
This commit is contained in:
2023-12-09 23:20:15 +01:00
parent c889771241
commit b4d05200d3
12 changed files with 633 additions and 124 deletions

View File

@@ -0,0 +1,18 @@
local utils = require("astrobox.utils")
return function(palette, config)
local HL = {}
local function load_mod(mod, mod_name)
local ok, res = pcall(mod, palette, config)
if ok and res then
HL = vim.tbl_extend("error", HL, res)
else
vim.notify("Failed to load module " .. mod_name .. " (" .. res .. ")")
end
end
utils.visit_astrobox_modules("highlights.modules", load_mod)
HL = vim.tbl_extend("force", HL, config.overrides)
return HL
end

View File

@@ -0,0 +1,11 @@
return function()
return {
HeirlineInactive = { link = "StatusInactive" },
HeirlineNormal = { link = "StatusNormal" },
HeirlineInsert = { link = "StatusInsert" },
HeirlineVisual = { link = "StatusVisual" },
HeirlineReplace = { link = "StatusReplace" },
HeirlineCommand = { link = "StatusCommand" },
HeirlineTerminal = { link = "StatusTerminal" },
}
end

View File

@@ -0,0 +1,6 @@
return function()
return {
cInclude = { link = "PreProc" },
cDefine = { link = "PreProc" }, -- Fix C ft setting this to Macro
}
end

View File

@@ -0,0 +1,133 @@
return function(palette)
return {
Normal = { fg = palette.fg, bg = palette.bg },
NormalNC = { link = "Normal" },
-- Italic = { italic = true },
-- Bold = { bold = true },
Conceal = { fg = palette.other.conceal, bg = palette.other.harder_bg },
SpecialKey = { fg = palette.none, bg = palette.colored_backgrounds.yellow },
NonText = { fg = palette.ui.fg_inactive, bg = palette.none },
EndOfBuffer = { fg = palette.bg, bg = palette.bg },
Directory = { fg = palette.blue, bg = palette.none },
QuickFixLine = palette.ui.selection,
MatchParen = { fg = palette.none, bg = palette.none, bold = true, underline = true },
Underlined = { fg = palette.cyan, bg = palette.none, underline = true },
-- Popup
FloatTitle = {
fg = palette.ui.float.title,
bg = palette.ui.bg,
bold = true,
},
FloatBorder = {
fg = palette.ui.float.border,
bg = palette.ui.bg,
},
NormalFloat = {
fg = palette.ui.float.text,
bg = palette.ui.bg,
},
Title = {
fg = palette.ui.float.title2,
bg = palette.bg,
bold = true,
},
-- Bars
TabLine = { fg = palette.ui.fg_inactive, bg = palette.ui.bg_inactive },
TabLineFill = { fg = palette.none, bg = palette.ui.bg_inactive },
TabLineSel = { fg = palette.ui.fg, bg = palette.ui.bg, bold = true, italic = true },
WinBar = { fg = palette.ui.winbar.fg, bg = palette.ui.winbar.bg },
WinBarNC = {
fg = palette.ui.winbar.fg_inactive,
bg = palette.ui.winbar.bg_inactive,
},
StatusLine = { fg = palette.ui.fg, bg = palette.ui.bg },
StatusLineNC = { fg = palette.ui.fg_inactive, bg = palette.ui.bg },
StatusNormal = { fg = palette.ui.bg, bg = palette.blue },
StatusInsert = { fg = palette.ui.bg, bg = palette.green },
StatusVisual = { fg = palette.ui.bg, bg = palette.purple },
StatusReplace = { fg = palette.ui.bg, bg = palette.red },
StatusCommand = { fg = palette.ui.bg, bg = palette.yellow },
StatusTerminal = { link = "StatusInsert" },
-- Cursor
Cursor = { fg = palette.fg, bg = palette.bg },
CursorIM = { link = "Cursor" },
lCursor = { link = "Cursor" },
CursorLineNr = { fg = palette.ui.fg, bg = palette.none },
LineNr = { fg = palette.ui.fg_inactive, bg = palette.none },
-- Columns
Folded = { fg = palette.ui.fg_inactive, bg = palette.none },
FoldColumn = { fg = palette.ui.fg_inactive, bg = palette.none },
SignColumn = { fg = palette.none, bg = palette.none }, -- TODO Test
ColorColumn = { fg = palette.none, bg = palette.other.bg_active },
CursorLine = { fg = palette.none, bg = palette.other.bg_active },
CursorColumn = { link = "CursorLine" },
-- Splits
WinSeparator = {
fg = palette.ui.win.separator,
bg = palette.bg,
-- bold = false,
},
VertSplit = {
fg = palette.ui.win.separator,
bg = palette.bg,
},
-- Diff
DiffAdd = { fg = palette.none, bg = palette.colored_backgrounds.green },
DiffChange = { fg = palette.none, bg = palette.colored_backgrounds.blue },
DiffDelete = { fg = palette.none, bg = palette.colored_backgrounds.red },
DiffText = { fg = palette.none, bg = palette.colored_backgrounds.yellow },
DiffAdded = { link = "DiffAdd" },
DiffRemoved = { link = "DiffDelete" },
DiffChanged = { link = "DiffText" }, -- TODO Switch to DiffChange?
DiffOldFile = { fg = palette.red, bg = palette.bg },
DiffNewFile = { fg = palette.green, bg = palette.bg },
DiffFile = palette.other.error_hl, -- TODO What's this?
DiffLine = palette.other.error_hl, -- TODO What's this?
DiffIndexLine = palette.other.error_hl, -- TODO What's this?
-- Cmd
ErrorMsg = { fg = palette.red, bg = palette.none },
WarningMsg = { fg = palette.yellow, bg = palette.none },
Question = { fg = palette.blue, bg = palette.none },
WildMenu = { fg = palette.ui.selection.fg, bg = palette.ui.selection.bg },
-- PMenu
Pmenu = { fg = palette.ui.fg, bg = palette.ui.bg_hard },
PmenuSel = { fg = palette.ui.selection.fg, bg = palette.ui.selection.bg },
PmenuSbar = { fg = palette.none, bg = palette.ui.float.scroll },
PmenuThumb = { link = "PmenuSbar" },
-- Search
Search = { fg = palette.fg, bg = palette.other.bg_active },
IncSearch = { fg = palette.none, bg = palette.colored_backgrounds.blue },
Substitute = { fg = palette.none, bg = palette.colored_backgrounds.yellow },
CurSearch = { link = "IncSearch" },
Visual = { fg = palette.none, bg = palette.other.bg_active },
VisualNOS = { fg = palette.other.bg_active, bg = palette.fg }, -- Meh
-- Spelling
SpellBad = { undercurl = true },
SpellCap = { undercurl = true },
SpellLocal = { undercurl = true },
SpellRare = { undercurl = true },
}
end

View File

@@ -0,0 +1,7 @@
return function(palette)
return {
GitSignsAdd = { fg = palette.green },
GitSignsChange = { fg = palette.yellow },
GitSignsDelete = { fg = palette.red },
}
end

View File

@@ -0,0 +1,170 @@
return function(palette)
return {
Boolean = { fg = palette.yellow, bg = palette.none },
Character = { link = "String" },
Comment = { fg = palette.gray, bg = palette.none, italic = true },
Conditional = { link = "Keyword" },
Constant = { fg = palette.aqua },
Debug = { fg = palette.blue, bg = palette.none },
Define = { link = "PreProc" },
Delimiter = { fg = palette.yellow, bg = palette.none },
Error = { fg = palette.red, bg = palette.none },
Exception = { link = "Keyword" },
Float = { link = "Number" },
Function = { fg = palette.fg_gradiant[1], bg = palette.none },
Identifier = { fg = palette.fg, bg = palette.none },
Ignore = { fg = palette.none, bg = palette.none },
Include = { link = "Keyword" },
Keyword = { fg = palette.red, bg = palette.none },
Label = { link = "Keyword" },
Macro = { fg = palette.orange, bg = palette.none },
Number = { fg = palette.yellow, bg = palette.none },
Operator = { fg = palette.orange, bg = palette.none },
PreCondit = { link = "PreProc" },
PreProc = { fg = palette.gray, bg = palette.none },
Repeat = { link = "Keyword" },
Special = { fg = palette.blue, bg = palette.none },
SpecialChar = { fg = palette.aqua, bg = palette.none },
SpecialComment = { fg = palette.bg_gradiant[4], bg = palette.none },
Statement = { link = "Identifier" },
StorageClass = { link = "Keyword" },
String = { fg = palette.green, bg = palette.none },
Structure = { link = "Keyword" },
Tag = { fg = palette.blue, bg = palette.none },
Todo = { fg = palette.yellow, bg = palette.harder_bg },
Type = { fg = palette.yellow, bg = palette.none },
Typedef = { link = "Keyword" },
-- Diags
DiagnosticError = { fg = palette.red },
DiagnosticHint = { fg = palette.aqua },
DiagnosticInfo = { fg = palette.blue },
DiagnosticWarn = { fg = palette.yellow },
DiagnosticUnderlineError = { sp = palette.red, undercurl = true },
DiagnosticUnderlineHint = { sp = palette.aqua, undercurl = true },
DiagnosticUnderlineInfo = { sp = palette.blue, undercurl = true },
DiagnosticUnderlineWarn = { sp = palette.yellow, undercurl = true },
LspInlayHint = { fg = palette.other.conceal, bg = palette.other.hard_bg },
LspCodeLens = { link = "LspInlayHint" },
LspCodeLensSeparator = { link = "LspCodeLens" },
LspReferenceRead = { fg = palette.none, bg = palette.harder_bg },
LspReferenceWrite = { fg = palette.none, bg = palette.harder_bg },
LspReferenceText = { fg = palette.none, bg = palette.softer_bg }, -- TODO Keep different?
["@annotation"] = { fg = palette.yellow },
["@attribute"] = { fg = palette.yellow },
["@boolean"] = { link = "Boolean" },
["@character"] = { link = "Character" },
["@character.special"] = { link = "SpecialChar" },
["@class"] = { fg = palette.yellow },
["@comment"] = { link = "Comment" },
["@comment.documentation"] = { fg = palette.gray, italic = false },
["@conditional"] = { link = "Conditional" },
["@constant"] = { link = "Constant" },
["@constant.builtin"] = { link = "@constant" },
["@constant.macro"] = { link = "@constant" },
["@constructor"] = { fg = palette.fg_gradiant[1], bold = true },
["@debug"] = { link = "Debug" },
["@decorator"] = { fg = palette.orange },
["@define"] = { link = "Define" },
["@enum"] = { fg = palette.cyan },
["@enumMember"] = { fg = palette.blue },
["@error"] = { link = "Error" },
["@event"] = { fg = palette.orange },
["@exception"] = { link = "Exception" },
["@field"] = { link = "Identifier" },
["@float"] = { link = "Float" },
["@function"] = { link = "Function" },
["@function.macro"] = { link = "Macro" },
["@include"] = { link = "Include" },
["@interface"] = { fg = palette.orange },
["@keyword"] = { link = "Keyword" },
["@label"] = { link = "Label" },
["@method"] = { fg = palette.fg_gradiant[1] },
["@modifier"] = { fg = palette.orange },
["@namespace"] = { fg = palette.fg_gradiant[2] },
["@none"] = { link = "Conceal" },
["@number"] = { link = "Number" },
["@operator"] = { link = "Operator" },
["@parameter"] = { fg = palette.fg_gradiant[1] },
["@preproc"] = { link = "PreProc" },
["@property"] = { link = "@field" },
["@punctuation.bracket"] = { link = "Identifier" },
["@punctuation.delimiter"] = { fg = palette.orange },
["@punctuation.special"] = { link = "Special" },
["@regexp"] = { fg = palette.cyan },
["@repeat"] = { link = "Repeat" },
["@storageclass"] = { link = "StorageClass" },
["@storageclass.lifeTime"] = { fg = palette.purple },
["@string"] = { link = "String" },
["@string.escape"] = { fg = palette.red },
["@string.regex"] = { fg = palette.aqua },
["@string.special"] = { link = "Special" },
["@struct"] = { fg = palette.yellow },
["@symbol"] = { link = "Special" },
["@tag"] = { fg = palette.red },
["@tag.attribute"] = { fg = palette.yellow },
["@tag.delimiter"] = { fg = palette.fg },
["@text"] = { fg = palette.fg },
["@text.checked"] = { fg = palette.green },
["@text.danger"] = { fg = palette.red },
["@text.diff.add"] = { link = "DiffAdded" },
["@text.diff.delete"] = { link = "DiffDelete" },
["@text.emphasis"] = { fg = palette.fg, italic = true },
["@text.environment"] = { fg = palette.yellow },
["@text.environment.name"] = { fg = palette.orange },
["@text.literal"] = { fg = palette.fg },
["@text.math"] = { fg = palette.aqua },
["@text.note"] = { fg = palette.aqua },
["@text.quote"] = { fg = palette.fg, italic = true },
["@text.reference"] = { fg = palette.aqua, bold = true },
["@text.strike"] = { fg = palette.fg, strikethrough = true },
["@text.strong"] = { fg = palette.fg, bold = true },
["@text.title"] = { fg = palette.green, bold = true },
["@text.title.1.markdown"] = { fg = palette.blue, bold = true },
["@text.title.2.markdown"] = { fg = palette.aqua, bold = true },
["@text.title.3.markdown"] = { fg = palette.purple, bold = true },
["@text.title.4.markdown"] = { fg = palette.yellow, bold = true },
["@text.todo"] = { link = "Todo" },
["@text.todo.checked"] = { link = "@text.checked" },
["@text.todo.danger"] = { link = "@text.danger" },
["@text.todo.note"] = { link = "@text.note" },
["@text.todo.unchecked"] = { link = "@text.unchecked" },
["@text.todo.warning"] = { link = "@text.warning" },
["@text.unchecked"] = { fg = palette.blue },
["@text.underline"] = { link = "Underline" },
["@text.uri"] = { link = "Underlined" },
["@text.warning"] = { fg = palette.yellow },
["@type"] = { link = "Type" },
["@type.qualifier"] = { fg = palette.purple },
["@typeParameter"] = { fg = palette.yellow },
["@variable"] = { link = "Identifier" },
["@variable.builtin"] = { bold = true },
-- LSP
["@lsp.mod.attribute"] = { link = "@attribute" },
["@lsp.mod.documentation"] = { link = "@comment.documentation" },
["@lsp.type"] = { link = "@type" },
["@lsp.type.attributeBracket"] = { fg = palette.orange },
["@lsp.type.derive"] = { fg = palette.orange },
["@lsp.type.enum"] = { link = "@enum" },
["@lsp.type.enumMember"] = { link = "@enumMember" },
["@lsp.type.interface"] = { fg = palette.orange },
["@lsp.type.keyword"] = { link = "Keyword" },
["@lsp.type.lifeTime"] = { fg = palette.purple },
["@lsp.type.method"] = { link = "@method" },
["@lsp.type.namespace"] = { fg = palette.fg_gradiant[1] },
["@lsp.type.operator"] = { link = "Operator" },
["@lsp.type.parameter"] = { link = "@parameter" },
["@lsp.type.property"] = { link = "@property" },
["@lsp.type.selfTypeKeyword"] = { fg = palette.aqua, bold = true },
["@lsp.type.struct"] = { link = "@struct" },
["@lsp.type.typeParameter"] = { link = "@type" },
["@lsp.type.variable"] = { link = "@variable" },
["@lsp.typemod.class.constructorOrDestructor"] = { link = "@constructor" },
["@lsp.typemod.method"] = { link = "@method" },
["@lsp.typemod.selfKeyword"] = { fg = palette.fg_gradiant[1], bold = true },
["@lsp.typemod.string.attribute"] = { link = "String" }, -- Hmmmm
["@lsp.typemod.variable.readonly"] = { link = "Constant" },
}
end