move load_highlight functions to colors & term_hl
This commit is contained in:
parent
083d18269b
commit
0a5d53fac0
4
init.lua
4
init.lua
|
|
@ -30,6 +30,4 @@ 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("colors").core_setup()
|
||||||
-- require("core.utils").load_highlight "nvim"
|
|
||||||
require("core.utils").load_highlight "core"
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
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.core_setup = function ()
|
||||||
|
require("colors.term_hl")
|
||||||
|
require("colors").load_highlight "syntax"
|
||||||
|
require("colors").load_highlight "nvim"
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
local colors = require("colors.kdark").colors
|
||||||
|
|
||||||
|
vim.g.terminal_color_0 = "#" .. colors.black
|
||||||
|
vim.g.terminal_color_1 = "#" .. colors.red
|
||||||
|
vim.g.terminal_color_2 = "#" .. colors.green
|
||||||
|
vim.g.terminal_color_3 = "#" .. colors.yellow
|
||||||
|
vim.g.terminal_color_4 = "#" .. colors.blue
|
||||||
|
vim.g.terminal_color_5 = "#" .. colors.magenta
|
||||||
|
vim.g.terminal_color_6 = "#" .. colors.cyan
|
||||||
|
vim.g.terminal_color_7 = "#" .. colors.white
|
||||||
|
vim.g.terminal_color_8 = "#" .. colors.bright_black
|
||||||
|
vim.g.terminal_color_9 = "#" .. colors.bright_red
|
||||||
|
vim.g.terminal_color_10 = "#" .. colors.bright_green
|
||||||
|
vim.g.terminal_color_11 = "#" .. colors.bright_yellow
|
||||||
|
vim.g.terminal_color_12 = "#" .. colors.bright_blue
|
||||||
|
vim.g.terminal_color_13 = "#" .. colors.bright_magenta
|
||||||
|
vim.g.terminal_color_14 = "#" .. colors.bright_cyan
|
||||||
|
vim.g.terminal_color_15 = "#" .. colors.bright_white
|
||||||
|
|
@ -1,22 +1,6 @@
|
||||||
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")
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ if not present then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
require("core.utils").load_highlight "cmp"
|
require("colors").load_highlight "cmp"
|
||||||
|
|
||||||
vim.opt.completeopt = "menuone,noselect"
|
vim.opt.completeopt = "menuone,noselect"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ if not present then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
require("core.utils").load_highlight "treesitter"
|
require("colors").load_highlight "treesitter"
|
||||||
|
|
||||||
local options = {
|
local options = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
|
|
|
||||||
Reference in New Issue