add option for overriding highlights (#596)

This commit is contained in:
siduck 2021-11-09 06:21:27 +05:30
parent c5fe1f711e
commit fd668e559e
4 changed files with 37 additions and 22 deletions

View file

@ -42,6 +42,7 @@ M.options = {
-- ui configs
M.ui = {
hl_override = "", -- path of your file which contains highlight stuffs
italic_comments = false,
-- theme to be used, check available themes with `<leader> + t + h`
theme = "onedark",

View file

@ -1,5 +1,6 @@
local M = {}
local cmd = vim.cmd
M.close_buffer = function(bufexpr, force)
-- This is a modification of a NeoVim plugin from
-- Author: ojroques - Olivier Roques
@ -330,4 +331,29 @@ M.packer_lazy_load = function(plugin, timer)
end
end
-- Highlights functions
-- Define bg color
-- @param group Group
-- @param color Color
M.bg = function(group, col)
cmd("hi " .. group .. " guibg=" .. col)
end
-- Define fg color
-- @param group Group
-- @param color Color
M.fg = function(group, col)
cmd("hi " .. group .. " guifg=" .. col)
end
-- Define bg and fg color
-- @param group Group
-- @param fgcol Fg Color
-- @param bgcol Bg Color
M.fg_bg = function(group, fgcol, bgcol)
cmd("hi " .. group .. " guifg=" .. fgcol .. " guibg=" .. bgcol)
end
return M