rm dead code | add terminal highlights

v2.5
siduck 4 years ago
parent 1fdb81e1f7
commit b6906663f7

@ -20,7 +20,7 @@ M.base_16 = {
-- some colors -- some colors
} }
M = require("base16").override_theme(M, "atheme") M = require("base46").override_theme(M, "atheme")
return M return M
``` ```
@ -30,7 +30,7 @@ return M
- Use a color lightening/darkening tool, such as this https://siduck.github.io/hex-tools/ - Use a color lightening/darkening tool, such as this https://siduck.github.io/hex-tools/
``` ```
black = usually your theme bg (this should be the same as base00 in doom-base16.lua) black = usually your theme bg
darker_black = 6% darker than black darker_black = 6% darker than black
black2 = 6% lighter than black black2 = 6% lighter than black

@ -1,51 +0,0 @@
local M = {}
M.get_colors = function(type)
local name
if vim.g.nvchad_theme then
name = vim.g.nvchad_theme
else
name = require("core.utils").load_config().ui.theme
vim.g.nvchad_theme = name
end
-- theme paths
local default_path = "hl_themes." .. name
local user_path = "custom.themes." .. name
local present1, default_theme = pcall(require, default_path)
local present2, user_theme = pcall(require, user_path)
if present1 then
return default_theme[type]
elseif present2 then
return user_theme[type]
else
error "No such theme bruh >_< "
end
end
M.merge_tb = function(table1, table2)
return vim.tbl_deep_extend("force", table1, table2)
end
M.load_theme = function()
-- reload highlights for theme switcher
require("plenary.reload").reload_module "integrations"
require("plenary.reload").reload_module "chadlights"
require "chadlights"
end
M.override_theme = function(default_theme, theme_name)
local changed_themes = require("core.utils").load_config().ui.changed_themes
if changed_themes[theme_name] then
return M.merge_tb(default_theme, changed_themes[theme_name])
else
return default_theme
end
end
return M

@ -16,6 +16,9 @@ for _, file in ipairs(hl_files) do
highlights = merge_tb(highlights, integration) highlights = merge_tb(highlights, integration)
end end
-- term colors
require "term_hl"
-- override user highlights if there are any -- override user highlights if there are any
local user_highlights = require("core.utils").load_config().ui.hl_override local user_highlights = require("core.utils").load_config().ui.hl_override
highlights = merge_tb(highlights, user_highlights) highlights = merge_tb(highlights, user_highlights)

@ -53,6 +53,6 @@ M.base_16 = {
base0F = "#e87979", base0F = "#e87979",
} }
M = require("base16").override_theme(M, "radium") M = require("base46").override_theme(M, "radium")
return M return M

@ -53,6 +53,6 @@ M.base_16 = {
base0F = "#F16269", base0F = "#F16269",
} }
M = require("base16").override_theme(M, "rxyhn") M = require("base46").override_theme(M, "rxyhn")
return M return M

@ -0,0 +1,18 @@
local colors = require("base46").get_colors "base_16"
vim.g.terminal_color_0 = "#" .. colors.base00
vim.g.terminal_color_1 = "#" .. colors.base08
vim.g.terminal_color_2 = "#" .. colors.base0B
vim.g.terminal_color_3 = "#" .. colors.base0A
vim.g.terminal_color_4 = "#" .. colors.base0D
vim.g.terminal_color_5 = "#" .. colors.base0E
vim.g.terminal_color_6 = "#" .. colors.base0C
vim.g.terminal_color_7 = "#" .. colors.base05
vim.g.terminal_color_8 = "#" .. colors.base03
vim.g.terminal_color_9 = "#" .. colors.base08
vim.g.terminal_color_10 = "#" .. colors.base0B
vim.g.terminal_color_11 = "#" .. colors.base0A
vim.g.terminal_color_12 = "#" .. colors.base0D
vim.g.terminal_color_13 = "#" .. colors.base0E
vim.g.terminal_color_14 = "#" .. colors.base0C
vim.g.terminal_color_15 = "#" .. colors.base07
Loading…
Cancel
Save