diff options
Diffstat (limited to 'lua/onedarker')
| -rw-r--r-- | lua/onedarker/Git.lua | 10 | ||||
| -rw-r--r-- | lua/onedarker/LSP.lua | 104 | ||||
| -rw-r--r-- | lua/onedarker/Treesitter.lua | 66 | ||||
| -rw-r--r-- | lua/onedarker/Whichkey.lua | 9 | ||||
| -rw-r--r-- | lua/onedarker/config.lua | 23 | ||||
| -rw-r--r-- | lua/onedarker/highlights.lua | 99 | ||||
| -rw-r--r-- | lua/onedarker/init.lua | 30 | ||||
| -rw-r--r-- | lua/onedarker/markdown.lua | 27 | ||||
| -rw-r--r-- | lua/onedarker/palette.lua | 39 | ||||
| -rw-r--r-- | lua/onedarker/util.lua | 25 | 
10 files changed, 432 insertions, 0 deletions
| diff --git a/lua/onedarker/Git.lua b/lua/onedarker/Git.lua new file mode 100644 index 00000000..b47ccf23 --- /dev/null +++ b/lua/onedarker/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 diff --git a/lua/onedarker/LSP.lua b/lua/onedarker/LSP.lua new file mode 100644 index 00000000..1ba7056b --- /dev/null +++ b/lua/onedarker/LSP.lua @@ -0,0 +1,104 @@ +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 = { style = "underline" }, +  LspDiagnosticsUnderlineWarning = { style = "underline" }, +  LspDiagnosticsUnderlineInformation = { style = "underline" }, +  LspDiagnosticsUnderlineHint = { style = "underline" }, +  QuickScopePrimary = { fg = C.purple_test, style = "underline" }, +  QuickScopeSecondary = { fg = C.cyan_test, style = "underline" }, +  TelescopeSelection = { fg = C.hint_blue }, +  TelescopeMatching = { fg = C.info_yellow, style = "bold" }, +  TelescopeBorder = { fg = C.cyan, bg = Config.transparent_background and "NONE" or 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 }, +  LirFloatNormal = { fg = C.light_gray, bg = C.alt_bg }, +  LirDir = { fg = C.blue }, +  LirSymLink = { fg = C.cyan }, +  LirEmptyDirText = { fg = C.blue }, +  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.gray, 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.hint_blue }, +  IndentBlanklineContextChar = { fg = C.context }, +  IndentBlanklineChar = { fg = C.dark_gray }, +  IndentBlanklineSpaceChar = { fg = C.cyan_test }, +  IndentBlanklineSpaceCharBlankline = { fg = C.info_yellow }, +  DashboardHeader = { fg = C.blue }, +  DashboardCenter = { fg = C.purple }, +  DashboardFooter = { fg = C.cyan }, +  xmlTag = { fg = C.blue }, +  xmlTagName = { fg = C.blue }, +  xmlEndTag = { fg = C.blue }, +  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" }, +  FocusedSymbol = { fg = C.purple, style = "bold" }, +  SymbolsOutlineConnector = { fg = C.context }, +} + +return LSP diff --git a/lua/onedarker/Treesitter.lua b/lua/onedarker/Treesitter.lua new file mode 100644 index 00000000..c8607ce5 --- /dev/null +++ b/lua/onedarker/Treesitter.lua @@ -0,0 +1,66 @@ +local Treesitter = { +  TSComment = { fg = C.gray }, +  TSAnnotation = { fg = C.blue }, +  TSAttribute = { fg = C.cyan }, +  TSConstructor = { fg = C.yellow }, +  TSType = { fg = C.yellow }, +  TSTypeBuiltin = { fg = C.yellow }, +  TSConditional = { fg = C.purple }, +  TSException = { fg = C.purple }, +  TSInclude = { fg = C.purple }, +  TSKeyword = { fg = C.purple }, +  TSKeywordReturn = { fg = C.purple }, +  TSKeywordFunction = { fg = C.purple }, +  TSLabel = { fg = C.red }, +  TSNone = { fg = C.fg }, +  TSNamespace = { fg = C.purple }, +  TSRepeat = { fg = C.purple }, +  TSConstant = { fg = C.orange }, +  TSConstBuiltin = { fg = C.orange }, +  TSFloat = { fg = C.orange }, +  TSNumber = { fg = C.orange }, +  TSBoolean = { fg = C.orange }, +  TSCharacter = { fg = C.green }, +  TSError = { fg = C.error_red }, +  TSFunction = { fg = C.blue }, +  TSFuncBuiltin = { fg = C.blue }, +  TSMethod = { fg = C.blue }, +  TSConstMacro = { fg = C.cyan }, +  TSFuncMacro = { fg = C.blue }, +  TSProperty = { fg = C.cyan }, +  TSOperator = { fg = C.purple }, +  TSField = { fg = C.blue }, +  TSParameter = { fg = C.red }, +  TSParameterReference = { fg = C.red }, +  TSVariable = { fg = C.fg }, +  TSVariableBuiltin = { fg = C.red }, +  TSSymbol = { fg = C.cyan }, +  TSText = { fg = C.fg }, +  TSTextReference = { fg = C.red }, +  TSPunctDelimiter = { fg = C.fg }, +  TSTagDelimiter = { fg = C.gray }, +  TSTagAttribute = { fg = C.orange }, +  TSPunctBracket = { fg = C.fg }, +  TSPunctSpecial = { fg = C.fg }, +  TSString = { fg = C.green }, +  TSStringRegex = { fg = C.orange }, +  TSStringEscape = { fg = C.orange }, +  TSTag = { fg = C.blue }, +  TSEmphasis = { style = "italic" }, +  TSUnderline = { style = "underline" }, +  TSWarning = { fg = C.warning_orange }, +  TSDanger = { fg = C.error_red }, +  TSTitle = { fg = C.blue, style = "bold" }, +  TSLiteral = { fg = C.green }, +  TSURI = { fg = C.blue, style = "underline" }, +  TSMath = { fg = C.fg }, +  TSKeywordOperator = { fg = C.purple }, +  TSStructure = { fg = C.fg }, +  TSStrong = { fg = C.yellow_orange }, +  TSQueryLinterError = { fg = C.warning_orange }, +  TSEnvironment = { fg = C.fg }, +  TSEnvironmentName = { fg = C.fg }, +  TSNote = { fg = C.blue }, +} + +return Treesitter diff --git a/lua/onedarker/Whichkey.lua b/lua/onedarker/Whichkey.lua new file mode 100644 index 00000000..86b42bd6 --- /dev/null +++ b/lua/onedarker/Whichkey.lua @@ -0,0 +1,9 @@ +local Whichkey = { +  WhichKey = { fg = C.purple }, +  WhichKeySeperator = { fg = C.green }, +  WhichKeyGroup = { fg = C.cyan }, +  WhichKeyDesc = { fg = C.blue }, +  WhichKeyFloat = { bg = C.dark }, +} + +return Whichkey diff --git a/lua/onedarker/config.lua b/lua/onedarker/config.lua new file mode 100644 index 00000000..ebac7109 --- /dev/null +++ b/lua/onedarker/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 diff --git a/lua/onedarker/highlights.lua b/lua/onedarker/highlights.lua new file mode 100644 index 00000000..e4b9eeac --- /dev/null +++ b/lua/onedarker/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 = Config.transparent_background and "NONE" or 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 = Config.transparent_background and "NONE" or C.bg }, +  Pmenu = { fg = C.light_gray, bg = C.popup_back }, +  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.green, style = "italic" }, +  Folded = { fg = C.accent, bg = C.alt_bg }, +  FoldColumn = { fg = C.accent, bg = C.alt_bg }, +  LineNr = { fg = C.context }, +  FloatBoder = { fg = C.gray, bg = C.alt_bg }, +  Whitespace = { fg = C.bg }, +  VertSplit = { fg = C.bg, bg = C.fg }, +  CursorLine = { bg = C.dark }, +  CursorColumn = { bg = C.dark }, +  ColorColumn = { bg = C.dark }, +  NormalFloat = { bg = C.dark }, +  Visual = { bg = C.ui_blue }, +  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.dark_gray }, +  PmenuSbar = { bg = C.alt_bg }, +  PmenuThumb = { bg = C.gray }, +  MatchWord = { style = "underline" }, +  MatchParen = { fg = C.hint_blue, 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.light_gray, bg = C.search_blue }, +  IncSearch = { fg = C.light_gray, bg = C.search_blue }, +  Substitute = { fg = C.light_gray, bg = C.search_orange }, +  MoreMsg = { fg = C.orange }, +  Question = { fg = C.orange }, +  EndOfBuffer = { fg = C.bg }, +  NonText = { fg = C.bg }, +  Variable = { fg = C.cyan }, +  String = { fg = C.green }, +  Character = { fg = C.green }, +  Constant = { fg = C.orange }, +  Number = { fg = C.orange }, +  Boolean = { fg = C.orange }, +  Float = { fg = C.orange }, +  Identifier = { fg = C.fg }, +  Function = { fg = C.blue }, +  Operator = { fg = C.purple }, +  Type = { fg = C.cyan }, +  StorageClass = { fg = C.cyan }, +  Structure = { fg = C.purple }, +  Typedef = { fg = C.purple }, +  Keyword = { fg = C.purple }, +  Statement = { fg = C.purple }, +  Conditional = { fg = C.purple }, +  Repeat = { fg = C.purple }, +  Label = { fg = C.cyan }, +  Exception = { fg = C.purple }, +  Include = { fg = C.purple }, +  PreProc = { fg = C.purple }, +  Define = { fg = C.purple }, +  Macro = { fg = C.purple }, +  PreCondit = { fg = C.purple }, +  Special = { fg = C.purple }, +  SpecialChar = { fg = C.fg }, +  Tag = { fg = C.blue }, +  Debug = { fg = C.red }, +  Delimiter = { fg = C.fg }, +  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.light_gray, bg = C.alt_bg }, +  TabLineSel = { fg = C.fg, bg = C.alt_bg }, +  TabLineFill = { fg = C.fg, bg = C.alt_bg }, +} + +return highlights diff --git a/lua/onedarker/init.lua b/lua/onedarker/init.lua new file mode 100644 index 00000000..852e0103 --- /dev/null +++ b/lua/onedarker/init.lua @@ -0,0 +1,30 @@ +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 = "onedarker" + +local util = require "onedarker.util" +Config = require "onedarker.config" +C = require "onedarker.palette" +local highlights = require "onedarker.highlights" +local Treesitter = require "onedarker.Treesitter" +local markdown = require "onedarker.markdown" +local Whichkey = require "onedarker.Whichkey" +local Git = require "onedarker.Git" +local LSP = require "onedarker.LSP" + +local skeletons = { +  highlights, +  Treesitter, +  markdown, +  Whichkey, +  Git, +  LSP, +} + +for _, skeleton in ipairs(skeletons) do +  util.initialise(skeleton) +end diff --git a/lua/onedarker/markdown.lua b/lua/onedarker/markdown.lua new file mode 100644 index 00000000..2b83e056 --- /dev/null +++ b/lua/onedarker/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 diff --git a/lua/onedarker/palette.lua b/lua/onedarker/palette.lua new file mode 100644 index 00000000..c3116b1e --- /dev/null +++ b/lua/onedarker/palette.lua @@ -0,0 +1,39 @@ +local colors = { +  fg = "#abb2bf", +  bg = "#1f2227", +  alt_bg = "#282c34", +  dark = "#282c34", +  accent = "#BBBBBB", +  dark_gray = "#2a2f3e", +  context = "#4b5263", +  popup_back = "#282c34", +  search_orange = "#613214", +  search_blue = "#5e81ac", +  gray = "#5c6370", +  light_gray = "#abb2bf", +  blue = "#61AFEF", +  dark_blue = "#223E55", +  green = "#98C379", +  cyan = "#56B6C2", +  red = "#e06c75", +  orange = "#D19A66", +  light_red = "#be5046", +  yellow = "#E5C07B", +  yellow_orange = "#D7BA7D", +  purple = "#C678DD", +  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 = "#ff007c", +  cyan_test = "#00dfff", +  ui_blue = "#264F78", +} + +return colors diff --git a/lua/onedarker/util.lua b/lua/onedarker/util.lua new file mode 100644 index 00000000..dbac18a2 --- /dev/null +++ b/lua/onedarker/util.lua @@ -0,0 +1,25 @@ +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 | 
