integrate colors into the config instead of plugin

This commit is contained in:
krolyxon 2022-09-10 14:16:11 +05:30
parent d993b4aa89
commit 083d18269b
10 changed files with 554 additions and 10 deletions

View File

@ -30,3 +30,6 @@ for _, module in ipairs(modules) do
end end
require("core.utils").load_mappings() require("core.utils").load_mappings()
-- require("core.utils").load_highlight "syntax"
-- require("core.utils").load_highlight "nvim"
require("core.utils").load_highlight "core"

View File

@ -0,0 +1,45 @@
local theme = require("colors.kdark").colors
local black = theme.black
local red = theme.red
local green = theme.green
local yellow = theme.yellow
local blue = theme.blue
local magenta = theme.magenta
local cyan = theme.cyan
local white = theme.white
local bright_black = theme.bright_black
local bright_red = theme.bright_red
local bright_green = theme.bright_green
local bright_yellow = theme.bright_yellow
local bright_blue = theme.bright_blue
local bright_magenta = theme.bright_magenta
local bright_cyan = theme.bright_cyan
local bright_white = theme.bright_white
return {
CmpItemKindConstant = { fg = bright_red },
CmpItemKindFunction = { fg = bright_magenta },
CmpItemKindIdentifier = { fg = bright_black },
CmpItemKindField = { fg = bright_black },
CmpItemKindVariable = { fg = bright_cyan },
Special = { fg = bright_blue },
CmpItemKindSnippet = { fg = red },
CmpItemKindText = { fg = bright_yellow },
CmpItemKindStructure = { fg = bright_cyan },
CmpItemKindType = { fg = bright_green },
CmpItemKindKeyword = { fg = white },
CmpItemKindMethod = { fg = bright_magenta },
CmpItemKindConstructor = { fg = blue },
CmpItemKindFolder = { fg = white },
CmpItemKindModule = { fg = bright_green },
CmpItemKindProperty = { fg = bright_black },
CmpItemKindUnit = { fg = bright_cyan },
CmpItemKindFile = { fg = white },
CmpItemKindColor = { fg = red },
CmpItemKindReference = { fg = magenta },
CmpItemKindStruct = { fg = bright_cyan },
CmpItemKindOperator = { fg = magenta },
CmpItemKindTypeParameter = { fg = bright_black },
}

View File

@ -0,0 +1,127 @@
local theme = require("colors.kdark").colors
local black = theme.black -- base00
local red = theme.red -- base01
local green = theme.green -- base02
local yellow = theme.yellow -- base03
local blue = theme.blue -- base04
local magenta = theme.magenta -- base05
local cyan = theme.cyan -- base06
local white = theme.white -- base07
local bright_black = theme.bright_black -- base08
local bright_red = theme.bright_red -- base09
local bright_green = theme.bright_green -- base0A
local bright_yellow = theme.bright_yellow -- base0B
local bright_blue = theme.bright_blue -- base0C
local bright_magenta = theme.bright_magenta -- base0D
local bright_cyan = theme.bright_cyan -- base0E
local bright_white = theme.bright_white -- base0F
return {
Comment = { fg = bright_black },
SignColumn = {
bg = '#000000',
},
-- line number
LineNr = { fg = bright_black },
CursorLineNr = { fg = white },
CursorLine = {
bg = black,
sp = "none",
},
-- those ugly ~'s
EndOfBuffer = { fg = black },
-- floating windows
FloatBorder = { fg = blue },
NormalFloat = { bg = black },
-- Pmenu i.e completion menu
Pmenu = { bg = black },
PmenuSbar = { bg = black },
PmenuSel = { bg = black, fg = white },
PmenuThumb = { bg = bright_black },
-- nvim cmp
CmpItemAbbr = { fg = white },
CmpItemAbbrMatch = { fg = blue, bold = true },
CmpBorder = { fg = bright_black },
CmpDocBorder = { fg = bright_black },
NvimInternalError = { fg = red },
WinSeparator = { fg = bright_black },
-- Dashboard i.e alpha.nvim
AlphaHeader = { fg = bright_black },
AlphaButtons = { fg = bright_black },
-- Gitsigns.nvim
DiffAdd = {
fg = blue,
},
DiffAdded = {
fg = green,
},
DiffChange = {
fg = bright_black,
},
DiffChangeDelete = {
fg = red,
},
DiffModified = {
fg = yellow,
},
DiffDelete = {
fg = red,
},
DiffRemoved = {
fg = red,
},
-- Indent blankline
IndentBlanklineChar = { fg = bright_black },
IndentBlanklineSpaceChar = { fg = bright_black },
-- Lsp Diagnostics
DiagnosticHint = { fg = magenta },
DiagnosticError = { fg = red },
DiagnosticWarn = { fg = yellow },
DiagnosticInformation = { fg = green },
-- NvimTree
NvimTreeEmptyFolderName = { fg = bright_blue },
NvimTreeEndOfBuffer = { fg = black },
NvimTreeFolderIcon = { fg = bright_blue },
NvimTreeFolderName = { fg = bright_blue },
NvimTreeGitDirty = { fg = red },
NvimTreeIndentMarker = { fg = bright_black },
NvimTreeNormal = { bg = '#000000' },
NvimTreeNormalNC = { bg = '#000000' },
NvimTreeOpenedFolderName = { fg = bright_blue },
NvimTreeGitIgnored = { fg = bright_black },
NvimTreeWinSeparator = {
fg = '#000000',
bg = '#000000',
},
NvimTreeWindowPicker = {
fg = red,
bg = black,
},
NvimTreeCursorLine = {
bg = black,
},
}

View File

@ -0,0 +1,130 @@
local theme = require("colors.kdark").colors
-- Standard syntax highlighting
local black = theme.black
local red = theme.red
local green = theme.green
local yellow = theme.yellow
local blue = theme.blue
local magenta = theme.magenta
local cyan = theme.cyan
local white = theme.white
local bright_black = theme.bright_black
local bright_red = theme.bright_red
local bright_green = theme.bright_green
local bright_yellow = theme.bright_yellow
local bright_blue = theme.bright_blue
local bright_magenta = theme.bright_magenta
local bright_cyan = theme.bright_cyan
local bright_white = theme.bright_white
return {
Boolean = {
fg = yellow,
},
Character = {
fg = magenta,
},
Conditional = {
fg = magenta,
},
Constant = {
fg = magenta,
},
Define = {
fg = magenta,
sp = "none",
},
Delimiter = {
fg = yellow,
},
Float = {
fg = yellow,
},
Function = {
fg = bright_blue,
},
Identifier = {
fg = magenta,
sp = "none",
},
Include = {
fg = bright_blue,
},
Keyword = {
fg = magenta,
},
Label = {
fg = yellow,
},
Number = {
fg = yellow,
},
Operator = {
fg = bright_black,
sp = "none",
},
PreProc = {
fg = yellow,
},
Repeat = {
fg = yellow,
},
Special = {
fg = bright_blue,
},
SpecialChar = {
fg = magenta,
},
Statement = {
fg = magenta,
},
StorageClass = {
fg = yellow,
},
String = {
fg = bright_green,
},
Structure = {
fg = magenta,
},
Tag = {
fg = yellow,
},
Todo = {
fg = yellow,
bg = bright_black,
},
Type = {
fg = yellow,
sp = "none",
},
Typedef = {
fg = yellow,
},
}

View File

@ -0,0 +1,185 @@
local theme = require("colors.kdark").colors
local black = theme.black -- base00
local red = theme.red -- base01
local green = theme.green -- base02
local yellow = theme.yellow -- base03
local blue = theme.blue -- base04
local magenta = theme.magenta -- base05
local cyan = theme.cyan -- base06
local white = theme.white -- base07
local bright_black = theme.bright_black -- base08
local bright_red = theme.bright_red -- base09
local bright_green = theme.bright_green -- base0A
local bright_yellow = theme.bright_yellow -- base0B
local bright_blue = theme.bright_blue -- base0C
local bright_magenta = theme.bright_magenta -- base0D
local bright_cyan = theme.bright_cyan -- base0E
local bright_white = theme.bright_white -- base0F
return {
TSAnnotation = {
fg = bright_magenta,
sp = "none",
},
TSAttribute = {
fg = bright_green,
sp = "none",
},
TSCharacter = {
fg = magenta,
sp = "none",
},
TSConstBuiltin = {
fg = bright_yellow,
sp = "none",
},
TSConstMacro = {
fg = magenta,
sp = "none",
},
TSError = {
fg = red,
sp = "none",
},
TSException = {
fg = magenta,
sp = "none",
},
TSFloat = {
fg = bright_yellow,
sp = "none",
},
TSFuncBuiltin = {
fg = bright_blue,
sp = "none",
},
TSFuncMacro = {
fg = magenta,
sp = "none",
},
TSKeywordOperator = {
fg = bright_magenta,
sp = "none",
},
TSMethod = {
fg = bright_blue,
sp = "none",
},
TSNamespace = {
fg = magenta,
sp = "none",
},
TSNone = {
fg = bright_black,
sp = "none",
},
TSParameter = {
fg = magenta,
sp = "none",
},
TSParameterReference = {
fg = yellow,
sp = "none",
},
TSPunctDelimiter = {
fg = yellow,
sp = "none",
},
TSPunctSpecial = {
fg = white,
sp = "none",
},
TSStringRegex = {
fg = cyan,
sp = "none",
},
TSStringEscape = {
fg = cyan,
sp = "none",
},
TSSymbol = {
fg = bright_green,
sp = "none",
},
TSTagDelimiter = {
fg = bright_red,
sp = "none",
},
TSText = {
fg = white,
sp = "none",
},
TSStrong = {
bold = true,
},
TSEmphasis = {
fg = theme.base09,
sp = "none",
},
TSStrike = {
fg = black,
sp = "none",
strikethrough = true,
},
TSLiteral = {
fg = bright_magenta,
sp = "none",
},
TSURI = {
fg = bright_magenta,
sp = "none",
underline = true,
},
TSTypeBuiltin = {
fg = yellow,
sp = "none",
},
TSVariableBuiltin = {
fg = bright_yellow,
sp = "none",
},
TSDefinition = {
sp = blue,
underline = true,
},
TSDefinitionUsage = {
sp = bright_black,
underline = true,
},
TSCurrentScope = {
bold = true,
},
}

44
lua/colors/kdark.lua Normal file
View File

@ -0,0 +1,44 @@
local M = {}
M.colors= {
-- black = "#131313", -- base00
black = "#000000", -- base00
red = "#cd0000", -- base01
green = "#00cd00", -- base02
yellow = "#cdcd00", -- base03
blue = "#0000ee", -- base04
magenta = "#cd00cd", -- base05
cyan = "#00cdcd", -- base06
white = "#e5e5e5", -- base07
bright_black = "#7f7f7f", -- base08
bright_red = "#ff0000", -- base09
bright_green = "#00ff00", -- base0A
bright_yellow = "#ffff00", -- base0B
bright_blue = "#5c5cff", -- base0C
bright_magenta = "#ff00ff", -- base0D
bright_cyan = "#00ffff", -- base0E
bright_white = "#ffffff", -- base0F
}
-- M.colors= {
-- black = "#131313", -- base00
-- red = "#353b45", -- base01
-- green = "#3e4451", -- base02
-- yellow = "#545862", -- base03
-- blue = "#565c64", -- base04
-- magenta = "#abb2bf", -- base05
-- cyan = "#b6bdca", -- base06
-- white = "#c8ccd4", -- base07
-- bright_black = "#cd00cd", -- base08
-- bright_red = "#d19a66", -- base09
-- bright_green = "#cdcd00", -- base0A
-- bright_yellow = "#00ff00", -- base0B
-- bright_blue = "#56b6c2", -- base0C
-- bright_magenta = "#5c5cff", -- base0D
-- bright_cyan = "#cd00cd", -- base0E
-- bright_white = "#be5046", -- base0F
-- }
return M

View File

@ -1,6 +1,22 @@
local M = {} local M = {}
local merge_tb = vim.tbl_deep_extend local merge_tb = vim.tbl_deep_extend
M.load_highlight = function(group)
if type(group) == "string" and group == "core" then
local syntax = require("colors.integrations.syntax")
local nvim = require("colors.integrations.nvim")
group = merge_tb("force", syntax, nvim)
end
if type(group) == "string" then
group = require("colors.integrations." .. group)
end
for hl, col in pairs(group) do
vim.api.nvim_set_hl(0, hl, col)
end
end
M.close_buffer = function(bufnr) M.close_buffer = function(bufnr)
if vim.bo.buftype == "terminal" then if vim.bo.buftype == "terminal" then
vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide") vim.cmd(vim.bo.buflisted and "set nobl | enew" or "hide")

View File

@ -4,6 +4,8 @@ if not present then
return return
end end
require("core.utils").load_highlight "cmp"
vim.opt.completeopt = "menuone,noselect" vim.opt.completeopt = "menuone,noselect"
local function border(hl_name) local function border(hl_name)

View File

@ -4,6 +4,8 @@ if not present then
return return
end end
require("core.utils").load_highlight "treesitter"
local options = { local options = {
ensure_installed = { ensure_installed = {
"lua", "lua",

View File

@ -162,16 +162,6 @@ local plugins = {
-- UI stuff -- UI stuff
["krolyxon/kdark"] = {
config = function()
local ok, kdark = pcall(require, "kdark")
if ok then
kdark.load_theme()
end
end,
},
["lukas-reineke/indent-blankline.nvim"] = { ["lukas-reineke/indent-blankline.nvim"] = {
event = "BufRead", event = "BufRead",
config = function() config = function()