diff options
Diffstat (limited to 'lua/spacegray')
-rw-r--r-- | lua/spacegray/Git.lua | 10 | ||||
-rw-r--r-- | lua/spacegray/LSP.lua | 92 | ||||
-rw-r--r-- | lua/spacegray/Treesitter.lua | 56 | ||||
-rw-r--r-- | lua/spacegray/Whichkey.lua | 9 | ||||
-rw-r--r-- | lua/spacegray/config.lua | 23 | ||||
-rw-r--r-- | lua/spacegray/highlights.lua | 99 | ||||
-rw-r--r-- | lua/spacegray/init.lua | 26 | ||||
-rw-r--r-- | lua/spacegray/markdown.lua | 27 | ||||
-rw-r--r-- | lua/spacegray/palette.lua | 33 | ||||
-rw-r--r-- | lua/spacegray/util.lua | 22 |
10 files changed, 397 insertions, 0 deletions
diff --git a/lua/spacegray/Git.lua b/lua/spacegray/Git.lua new file mode 100644 index 00000000..f1a2ed39 --- /dev/null +++ b/lua/spacegray/Git.lua @@ -0,0 +1,10 @@ +local Git = { + SignAdd = {fg = C.sign_add, }, + SignChange = {fg = C.sign_change, }, + SignDelete = {fg = C.sign_delete, }, + GitSignsAdd = {fg = C.sign_add, }, + GitSignsChange = {fg = C.sign_change, }, + GitSignsDelete = {fg = C.sign_delete, }, +} + +return Git
\ No newline at end of file diff --git a/lua/spacegray/LSP.lua b/lua/spacegray/LSP.lua new file mode 100644 index 00000000..eb674175 --- /dev/null +++ b/lua/spacegray/LSP.lua @@ -0,0 +1,92 @@ +local LSP = { + LspDiagnosticsDefaultError = {fg = C.error_red, }, + LspDiagnosticsDefaultWarning = {fg = C.warning_orange, }, + LspDiagnosticsDefaultInformation = {fg = C.info_yellow, }, + LspDiagnosticsDefaultHint = {fg = C.hint_blue, }, + LspDiagnosticsVirtualTextError = {fg = C.error_red, }, + LspDiagnosticsVirtualTextWarning = {fg = C.warning_orange, }, + LspDiagnosticsVirtualTextInformation = {fg = C.info_yellow, }, + LspDiagnosticsVirtualTextHint = {fg = C.hint_blue, }, + LspDiagnosticsFloatingError = {fg = C.error_red, }, + LspDiagnosticsFloatingWarning = {fg = C.warning_orange, }, + LspDiagnosticsFloatingInformation = {fg = C.info_yellow, }, + LspDiagnosticsFloatingHint = {fg = C.hint_blue, }, + LspDiagnosticsSignError = {fg = C.error_red, }, + LspDiagnosticsSignWarning = {fg = C.warning_orange, }, + LspDiagnosticsSignInformation = {fg = C.info_yellow, }, + LspDiagnosticsSignHint = {fg = C.hint_blue, }, + LspDiagnosticsError = {fg = C.error_red, }, + LspDiagnosticsWarning = {fg = C.warning_orange, }, + LspDiagnosticsInformation = {fg = C.info_yellow, }, + LspDiagnosticsHint = {fg = C.hint_blue, }, + LspDiagnosticsUnderlineError = {fg = C.error_red, }, + LspDiagnosticsUnderlineWarning = {fg = C.warning_orange, }, + LspDiagnosticsUnderlineInformation = {fg = C.info_yellow, }, + LspDiagnosticsUnderlineHint = {fg = C.hint_blue, }, + QuickScopePrimary = {fg = C.cyan_test, style = "underline", }, + QuickScopeSecondary = {fg = C.purple_test, style = "underline", }, + TelescopeSelection = {fg = C.hint_blue, }, + TelescopeMatching = {fg = C.info_yellow, style = "bold", }, + TelescopeBorder = {fg = C.cyan, bg = C.bg, }, + NvimTreeFolderIcon = {fg = C.blue, }, + NvimTreeIndentMarker = {fg = C.gray, }, + NvimTreeNormal = {fg = C.light_gray, bg = C.alt_bg, }, + NvimTreeVertSplit = {fg = C.alt_bg, bg = C.alt_bg, }, + NvimTreeFolderName = {fg = C.blue, }, + NvimTreeOpenedFolderName = {fg = C.cyan, style = "italic", }, + NvimTreeImageFile = {fg = C.purple, }, + NvimTreeSpecialFile = {fg = C.orange, }, + NvimTreeGitStaged = {fg = C.sign_add, }, + NvimTreeGitNew = {fg = C.sign_add, }, + NvimTreeGitDirty = {fg = C.sign_add, }, + NvimTreeGitDeleted = {fg = C.sign_delete, }, + NvimTreeGitMerge = {fg = C.sign_change, }, + NvimTreeGitRenamed = {fg = C.sign_change, }, + NvimTreeSymlink = {fg = C.cyan, }, + NvimTreeRootFolder = {fg = C.fg, style = "bold", }, + NvimTreeExecFile = {fg = C.green, }, + BufferCurrent = {fg = C.fg, bg = C.bg, }, + BufferCurrentIndex = {fg = C.fg, bg = C.bg, }, + BufferCurrentMod = {fg = C.info_yellow, bg = C.bg, }, + BufferCurrentSign = {fg = C.hint_blue, bg = C.bg, }, + BufferCurrentTarget = {fg = C.red, bg = C.bg, style = "bold", }, + BufferVisible = {fg = C.fg, bg = C.bg, }, + BufferVisibleIndex = {fg = C.fg, bg = C.bg, }, + BufferVisibleMod = {fg = C.info_yellow, bg = C.bg, }, + BufferVisibleSign = {fg = C.hint_blue, bg = C.bg, }, + BufferVisibleTarget = {fg = C.red, bg = C.bg, style = "bold", }, + BufferInactive = {fg = C.gray, bg = C.alt_bg, }, + BufferInactiveIndex = {fg = C.gray, bg = C.alt_bg, }, + BufferInactiveMod = {fg = C.info_yellow, bg = C.alt_bg, }, + BufferInactiveSign = {fg = C.gray, bg = C.alt_bg, }, + BufferInactiveTarget = {fg = C.red, bg = C.alt_bg, style = "bold", }, + StatusLine = {fg = C.alt_bg, }, + StatusLineNC = {fg = C.alt_bg, }, + StatusLineSeparator = {fg = C.alt_bg, }, + StatusLineTerm = {fg = C.alt_bg, }, + StatusLineTermNC = {fg = C.alt_bg, }, + CodiVirtualText = {fg = C.pale_purple, }, + IndentBlanklineContextChar = {fg = C.accent, }, + DashboardHeader = {fg = C.blue, }, + DashboardCenter = {fg = C.purple, }, + DashboardFooter = {fg = C.cyan, }, + CompeDocumentation = {bg = C.alt_bg, }, + DiffViewNormal = {fg = C.gray, bg = C.alt_bg, }, + DiffviewStatusAdded = {fg = C.sign_add, }, + DiffviewStatusModified = {fg = C.sign_change, }, + DiffviewStatusRenamed = {fg = C.sign_change, }, + DiffviewStatusDeleted = {fg = C.sign_delete, }, + DiffviewFilePanelInsertion = {fg = C.sign_add, }, + DiffviewFilePanelDeletion = {fg = C.sign_delete, }, + DiffviewVertSplit = {bg = C.bg, }, + diffAdded = {fg = C.sign_add, }, + diffRemoved = {fg = C.sign_delete, }, + diffFileId = {fg = C.blue, style = "bold,reverse", }, + diffFile = {fg = C.alt_bg, }, + diffNewFile = {fg = C.green, }, + diffOldFile = {fg = C.red, }, + debugPc = {bg = C.cyan, }, + debugBreakpoint = {fg = C.red, style = "reverse", }, +} + +return LSP
\ No newline at end of file diff --git a/lua/spacegray/Treesitter.lua b/lua/spacegray/Treesitter.lua new file mode 100644 index 00000000..95348406 --- /dev/null +++ b/lua/spacegray/Treesitter.lua @@ -0,0 +1,56 @@ +local Treesitter = { + TSComment = {fg = C.gray, }, + TSAnnotation = {fg = C.purple, }, + TSAttribute = {fg = C.cyan, }, + TSConstructor = {fg = C.purple, }, + TSType = {fg = C.purple, }, + TSTypeBuiltin = {fg = C.purple, }, + TSConditional = {fg = C.blue, }, + TSException = {fg = C.blue, }, + TSInclude = {fg = C.blue, }, + TSKeyword = {fg = C.blue, }, + TSKeywordFunction = {fg = C.blue, }, + TSLabel = {fg = C.blue, }, + TSNamespace = {fg = C.blue, }, + TSRepeat = {fg = C.blue, }, + TSConstant = {fg = C.orange, }, + TSConstBuiltin = {fg = C.orange, }, + TSFloat = {fg = C.red, }, + TSNumber = {fg = C.red, }, + TSBoolean = {fg = C.red, }, + TSCharacter = {fg = C.light_green, }, + TSError = {fg = C.error_red, }, + TSFunction = {fg = C.yellow, }, + TSFuncBuiltin = {fg = C.yellow, }, + TSMethod = {fg = C.yellow, }, + TSConstMacro = {fg = C.cyan, }, + TSFuncMacro = {fg = C.cyan, }, + TSVariable = {fg = C.white, }, + TSVariableBuiltin = {fg = C.cyan, }, + TSProperty = {fg = C.cyan, }, + TSOperator = {fg = C.gray_blue, }, + TSField = {fg = C.white, }, + TSParameter = {fg = C.white, }, + TSParameterReference = {fg = C.white, }, + TSSymbol = {fg = C.white, }, + TSText = {fg = C.fg, }, + TSPunctDelimiter = {fg = C.gray, }, + TSTagDelimiter = {fg = C.gray, }, + TSPunctBracket = {fg = C.gray, }, + TSPunctSpecial = {fg = C.gray, }, + TSString = {fg = C.green, }, + TSStringRegex = {fg = C.light_green, }, + TSStringEscape = {fg = C.light_green, }, + TSTag = {fg = C.blue, }, + TSEmphasis = {style = "italic", }, + TSUnderline = {style = "underline", }, + TSTitle = {fg = C.blue, style = "bold", }, + TSLiteral = {fg = C.green, }, + TSURI = {fg = C.cyan, style = "underline", }, + TSKeywordOperator = {fg = C.blue, }, + TSStructure = {fg = C.purple_test, }, + TSStrong = {fg = C.yellow, }, + TSQueryLinterError = {fg = C.warning_orange, }, +} + +return Treesitter
\ No newline at end of file diff --git a/lua/spacegray/Whichkey.lua b/lua/spacegray/Whichkey.lua new file mode 100644 index 00000000..2c02f11b --- /dev/null +++ b/lua/spacegray/Whichkey.lua @@ -0,0 +1,9 @@ +local Whichkey = { + WhichKey = {fg = C.purple, }, + WhichKeySeperator = {fg = C.green, }, + WhichKeyGroup = {fg = C.blue, }, + WhichKeyDesc = {fg = C.cyan, }, + WhichKeyFloat = {bg = C.alt_bg, }, +} + +return Whichkey
\ No newline at end of file diff --git a/lua/spacegray/config.lua b/lua/spacegray/config.lua new file mode 100644 index 00000000..f9c10951 --- /dev/null +++ b/lua/spacegray/config.lua @@ -0,0 +1,23 @@ +local config + +vim = vim or { g = {}, o = {} } + +local function opt(key, default) + if vim.g[key] == nil then + return default + end + if vim.g[key] == 0 then + return false + end + return vim.g[key] +end + +config = { + transparent_background = opt("transparent_background", false), + italic_comments = opt("italic_keywords", true) and "italic" or "NONE", + italic_keywords = opt("italic_keywords", true) and "italic" or "NONE", + italic_functions = opt("italic_function", false) and "italic" or "NONE", + italic_variables = opt("italic_variables", true) and "italic" or "NONE", +} + +return config
\ No newline at end of file diff --git a/lua/spacegray/highlights.lua b/lua/spacegray/highlights.lua new file mode 100644 index 00000000..9a20b46d --- /dev/null +++ b/lua/spacegray/highlights.lua @@ -0,0 +1,99 @@ +local highlights = { + Normal = {fg = C.fg, bg = Config.transparent_background and "NONE" or C.bg, }, + SignColumn = {bg = C.bg, }, + MsgArea = {fg = C.fg, bg = C.bg, }, + ModeMsg = {fg = C.fg, bg = C.bg, }, + MsgSeparator = {fg = C.fg, bg = C.bg, }, + SpellBad = {fg = C.error_red, style = "underline", }, + SpellCap = {fg = C.yellow, style = "underline", }, + SpellLocal = {fg = C.green, style = "underline", }, + SpellRare = {fg = C.purple, style = "underline", }, + NormalNC = {fg = C.fg, bg = C.bg, }, + Pmenu = {fg = C.white, bg = C.accent, }, + PmenuSel = {fg = C.alt_bg, bg = C.blue, }, + WildMenu = {fg = C.alt_bg, bg = C.blue, }, + CursorLineNr = {fg = C.light_gray, style = "bold", }, + Comment = {fg = C.gray, style = "italic", }, + Folded = {fg = C.accent, bg = C.alt_bg, }, + FoldColumn = {fg = C.accent, bg = C.alt_bg, }, + LineNr = {fg = C.gray, }, + FloatBoder = {fg = C.gray, bg = C.alt_bg, }, + Whitespace = {fg = C.gray, }, + VertSplit = {fg = C.bg, bg = C.accent, }, + CursorLine = {bg = C.alt_bg, }, + CursorColumn = {bg = C.alt_bg, }, + ColorColumn = {bg = C.alt_bg, }, + NormalFloat = {bg = C.alt_bg, }, + Visual = {bg = C.alt_bg, }, + VisualNOS = {bg = C.alt_bg, }, + WarningMsg = {fg = C.error_red, bg = C.bg, }, + DiffAdd = {fg = C.alt_bg, bg = C.sign_add, }, + DiffChange = {fg = C.alt_bg, bg = C.sign_change, style = "underline", }, + DiffDelete = {fg = C.alt_bg, bg = C.sign_delete, }, + QuickFixLine = {bg = C.accent, }, + PmenuSbar = {bg = C.alt_bg, }, + PmenuThumb = {bg = C.white, }, + MatchWord = {style = "underline", }, + MatchParen = {fg = C.pale_purple, bg = C.bg, style = "underline", }, + MatchWordCur = {style = "underline", }, + MatchParenCur = {style = "underline", }, + Cursor = {fg = C.cursor_fg, bg = C.cursor_bg, }, + lCursor = {fg = C.cursor_fg, bg = C.cursor_bg, }, + CursorIM = {fg = C.cursor_fg, bg = C.cursor_bg, }, + TermCursor = {fg = C.cursor_fg, bg = C.cursor_bg, }, + TermCursorNC = {fg = C.cursor_fg, bg = C.cursor_bg, }, + Conceal = {fg = C.accent, }, + Directory = {fg = C.blue, }, + SpecialKey = {fg = C.blue, style = "bold", }, + Title = {fg = C.blue, style = "bold", }, + ErrorMsg = {fg = C.error_red, bg = C.bg, style = "bold", }, + Search = {fg = C.hint_blue, bg = C.alt_bg, }, + IncSearch = {fg = C.hint_blue, bg = C.alt_bg, }, + Substitute = {fg = C.alt_bg, bg = C.gray_blue, }, + MoreMsg = {fg = C.cyan, }, + Question = {fg = C.cyan, }, + EndOfBuffer = {fg = C.bg, }, + NonText = {fg = C.bg, }, + Variable = {fg = C.white, }, + String = {fg = C.green, }, + Character = {fg = C.light_green, }, + Constant = {fg = C.orange, }, + Number = {fg = C.red, }, + Boolean = {fg = C.red, }, + Float = {fg = C.red, }, + Identifier = {fg = C.white, }, + Function = {fg = C.yellow, }, + Operator = {fg = C.gray_blue, }, + Type = {fg = C.purple, }, + StorageClass = {fg = C.purple, }, + Structure = {fg = C.purple, }, + Typedef = {fg = C.purple, }, + Keyword = {fg = C.blue, }, + Statement = {fg = C.blue, }, + Conditional = {fg = C.blue, }, + Repeat = {fg = C.blue, }, + Label = {fg = C.blue, }, + Exception = {fg = C.blue, }, + Include = {fg = C.blue, }, + PreProc = {fg = C.cyan, }, + Define = {fg = C.cyan, }, + Macro = {fg = C.cyan, }, + PreCondit = {fg = C.cyan, }, + Special = {fg = C.orange, }, + SpecialChar = {fg = C.orange, }, + Tag = {fg = C.blue, }, + Debug = {fg = C.red, }, + Delimiter = {fg = C.gray, }, + SpecialComment = {fg = C.gray, }, + Underlined = {style = "underline", }, + Bold = {style = "bold", }, + Italic = {style = "italic", }, + Ignore = {fg = C.cyan, bg = C.bg, style = "bold", }, + Todo = {fg = C.red, bg = C.bg, style = "bold", }, + Error = {fg = C.error_red, bg = C.bg, style = "bold", }, + TabLine = {fg = C.white, bg = C.alt_bg, }, + TabLineSel = {fg = C.white, bg = C.alt_bg, }, + TabLineFill = {fg = C.white, bg = C.alt_bg, }, +} + +return highlights
\ No newline at end of file diff --git a/lua/spacegray/init.lua b/lua/spacegray/init.lua new file mode 100644 index 00000000..0a8e748e --- /dev/null +++ b/lua/spacegray/init.lua @@ -0,0 +1,26 @@ +vim.api.nvim_command("hi clear") +if vim.fn.exists("syntax_on") then + vim.api.nvim_command("syntax reset") +end +vim.o.background = "dark" +vim.o.termguicolors = true +vim.g.colors_name = "spacegray" + +local util = require("spacegray.util") +Config = require("spacegray.config") +C = require("spacegray.palette") +local highlights = require("spacegray.highlights") +local Treesitter = require("spacegray.Treesitter") +local markdown = require("spacegray.markdown") +local Whichkey = require("spacegray.Whichkey") +local Git = require("spacegray.Git") +local LSP = require("spacegray.LSP") + + +local skeletons = { + highlights, Treesitter, markdown, Whichkey, Git, LSP +} + +for _, skeleton in ipairs(skeletons) do + util.initialise(skeleton) +end
\ No newline at end of file diff --git a/lua/spacegray/markdown.lua b/lua/spacegray/markdown.lua new file mode 100644 index 00000000..19863dc8 --- /dev/null +++ b/lua/spacegray/markdown.lua @@ -0,0 +1,27 @@ +local markdown = { + markdownBlockquote = {fg = C.accent, }, + markdownBold = {fg = C.yellow, style = "bold", }, + markdownCode = {fg = C.green, }, + markdownCodeBlock = {fg = C.green, }, + markdownCodeDelimiter = {fg = C.green, }, + markdownH1 = {fg = C.blue, }, + markdownH2 = {fg = C.blue, }, + markdownH3 = {fg = C.blue, }, + markdownH4 = {fg = C.blue, }, + markdownH5 = {fg = C.blue, }, + markdownH6 = {fg = C.blue, }, + markdownHeadingDelimiter = {fg = C.red, }, + markdownHeadingRule = {fg = C.accent, }, + markdownId = {fg = C.purple, }, + markdownIdDeclaration = {fg = C.blue, }, + markdownIdDelimiter = {fg = C.light_gray, }, + markdownLinkDelimiter = {fg = C.light_gray, }, + markdownItalic = {style = "italic", }, + markdownLinkText = {fg = C.blue, }, + markdownListMarker = {fg = C.red, }, + markdownOrderedListMarker = {fg = C.red, }, + markdownRule = {fg = C.accent, }, + markdownUrl = {fg = C.cyan, style = "underline", }, +} + +return markdown
\ No newline at end of file diff --git a/lua/spacegray/palette.lua b/lua/spacegray/palette.lua new file mode 100644 index 00000000..49e429e5 --- /dev/null +++ b/lua/spacegray/palette.lua @@ -0,0 +1,33 @@ +local colors = { + fg = "#c8c9d1", + bg = "#212121", + alt_bg = "#2a2a2a", + accent = "#383d45", + white = "#c8c9d1", + gray = "#858585", + light_gray = "#c8c9c1", + blue = "#5486c0", + gray_blue = "#66899d", + cyan = "#65a7c5", + red = "#b04b57", + green = "#87b379", + light_green = "#b2d77c", + yellow = "#eeba5a", + orange = "#c6735a", + purple = "#bf83c1", + pale_purple = "#7199ee", + magenta = "#D16D9E", + cursor_fg = "#515052", + cursor_bg = "#AEAFAD", + sign_add = "#587c0c", + sign_change = "#0c7d9d", + sign_delete = "#94151b", + error_red = "#F44747", + warning_orange = "#ff8800", + info_yellow = "#FFCC66", + hint_blue = "#4FC1FF", + purple_test = "#ff00ff", + cyan_test = "#00ffff", +} + +return colors diff --git a/lua/spacegray/util.lua b/lua/spacegray/util.lua new file mode 100644 index 00000000..1cc5a009 --- /dev/null +++ b/lua/spacegray/util.lua @@ -0,0 +1,22 @@ +local M = {} + +local function highlight(group, properties) + local bg = properties.bg == nil and "" or "guibg=" .. properties.bg + local fg = properties.fg == nil and "" or "guifg=" .. properties.fg + local style = properties.style == nil and "" or "gui=" .. properties.style + + local cmd = table.concat({ + "highlight", group, bg, fg, style + }, " ") + + vim.api.nvim_command(cmd) +end + + +function M.initialise(skeleton) + for group, properties in pairs(skeleton) do + highlight(group, properties) + end +end + +return M
\ No newline at end of file |