gruber-darker.nvim/lua/gruber-darker.lua

53 lines
1.2 KiB
Lua
Raw Normal View History

local config = require("gruber-darker.config")
2023-03-26 01:10:26 +01:00
local highlights = require("gruber-darker.highlights")
2023-01-10 21:11:37 +01:00
local M = {}
2023-01-10 21:11:37 +01:00
---Delete GruberDarker autocmds when the
---theme changes to something else
---@package
function M.on_colorscheme()
2023-03-14 03:09:44 +01:00
vim.cmd([[autocmd! GruberDarker]])
vim.cmd([[augroup! GruberDarker]])
2023-01-10 21:11:37 +01:00
end
---Clear current highlights and set Neovim global `colors_name`
function M.load()
2023-03-14 03:09:44 +01:00
if vim.g.colors_name then
vim.cmd.hi("clear")
end
vim.opt.termguicolors = true
vim.g.colors_name = "GruberDarker"
2023-03-25 23:43:49 +01:00
highlights.setup()
2023-03-14 03:09:44 +01:00
local gruber_darker_group = vim.api.nvim_create_augroup("GruberDarker", { clear = true })
vim.api.nvim_create_autocmd("ColorSchemePre", {
group = gruber_darker_group,
pattern = "*",
callback = function()
require("gruber-darker").on_colorscheme()
end,
})
-- vim.api.nvim_create_autocmd("FileType", {
-- group = gruber_darker_group,
-- pattern = "qf,help",
-- callback = function()
-- vim.cmd.setlocal("winhighlight=Normal:NormalSB,SignColumn:SignColumnSB")
-- end,
-- })
end
2023-01-10 21:11:37 +01:00
---Change colorscheme to GruberDarker
2023-03-14 03:09:44 +01:00
function M.colorscheme() end
---GruberDarker configuration bootstrapper
---@param opts Options
function M.setup(opts)
2023-03-14 03:09:44 +01:00
config.set(opts or {})
end
return M