-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.lua
68 lines (54 loc) · 1.6 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
local highlights = require("gruvbox-material.highlights")
local utils = require("gruvbox-material.utils")
local function set_default_global_options()
local opts = {
enable_italic_comment = 1,
diagnostic_text_highlight = 0,
diagnostic_virtual_text = "grey",
sign_column_background = "none",
transparent_background = 0,
}
for key, val in pairs(opts) do
-- add prefix
local key = "gruvbox_material_" .. key
if vim.g[key] == nil then
vim.g[key] = val
end
end
end
local gruvbox = {}
function gruvbox.setup(cfg)
--TODO: use the configuration to configure the lua plugin
if vim.g.loaded_gruvbox_material == 1 then
return
end
vim.g.loaded_gruvbox_material = 1
set_default_global_options()
vim.cmd("highlight clear")
if vim.fn.exists("syntax_on") then
vim.cmd("syntax reset")
end
vim.o.background = "dark"
vim.o.termguicolors = true
vim.g.colors_name = "gruvbox-material"
-- NOTE: I think we can refactor this, but I don't know how
for group, colors in pairs(highlights.custom()) do
utils.highlight(group, colors)
end
for group, colors in pairs(highlights.syntax()) do
utils.highlight(group, colors)
end
for group, colors in pairs(highlights.highlight_groups()) do
utils.highlight(group, colors)
end
for group, colors in pairs(highlights.filetype_specific()) do
utils.highlight(group, colors)
end
for group, colors in pairs(highlights.treesitter()) do
utils.highlight(group, colors)
end
for group, colors in pairs(highlights.plugin_specific()) do
utils.highlight(group, colors)
end
end
return gruvbox