-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathconfig.lua
159 lines (145 loc) · 4.25 KB
/
config.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
local M = {}
---@class CyberdreamHighlight
---@field fg? string
---@field bg? string
---@field sp? string
---@field bold? boolean
---@field italic? boolean
---@field underline? boolean
---@field strikethrough? boolean
---@alias Colors table<CyberdreamPalette|CyberdreamPalette|string, string>
---@alias CyberdreamOverrideFn fun(palette: CyberdreamPalette): CyberdreamHighlight
---@class extensions
---@field alpha? boolean
---@field blinkcmp? boolean
---@field cmp? boolean
---@field dashboard? boolean
---@field fzflua? boolean
---@field gitpad? boolean
---@field gitsigns? boolean
---@field grapple? boolean
---@field grugfar? boolean
---@field heirline? boolean
---@field helpview? boolean
---@field hop? boolean
---@field indentblankline? boolean
---@field kubectl? boolean
---@field lazy? boolean
---@field leap? boolean
---@field markdown? boolean
---@field markview? boolean
---@field mini? boolean
---@field neogit? boolean
---@field noice? boolean
---@field notify? boolean
---@field rainbow_delimiters? boolean
---@field snacks? boolean
---@field telescope? boolean
---@field treesitter? boolean
---@field treesittercontext? boolean
---@field trouble? boolean
---@field whichkey? boolean
---@class Config
---@field transparent? boolean
---@field variant? "default" | "light" | "auto"
---@field saturation? number
---@field colors? CyberdreamPalette
---@field highlights? table<string, CyberdreamHighlight>
---@field overrides? CyberdreamOverrideFn
---@field italic_comments? boolean
---@field hide_fillchars? boolean
---@field borderless_pickers? boolean
---@field terminal_colors? boolean
---@field cache? boolean
---@field extensions? extensions
local default_options = {
transparent = false,
variant = "default",
saturation = 1,
---@diagnostic disable-next-line: missing-fields
colors = {},
highlights = {},
italic_comments = false,
hide_fillchars = false,
borderless_pickers = false,
terminal_colors = true,
cache = false,
extensions = {
alpha = true,
blinkcmp = true,
cmp = true,
dashboard = true,
fzflua = true,
gitpad = true,
gitsigns = true,
grapple = true,
grugfar = true,
heirline = true,
helpview = true,
hop = true,
indentblankline = true,
kubectl = true,
lazy = true,
leap = true,
markdown = true,
markview = true,
mini = true,
noice = true,
neogit = true,
notify = true,
rainbow_delimiters = true,
snacks = true,
telescope = true,
treesitter = true,
treesittercontext = true,
trouble = true,
whichkey = true,
},
}
---@type Config
M.options = {}
---@param options Config|nil
function M.setup(options)
options = options or {}
-- Handle deprecated options TODO: Remove post v5.0.0 release
---@diagnostic disable: undefined-field
if options.borderless_telescope ~= nil then
vim.defer_fn(function()
vim.notify(
"The 'borderless_telescope' is deprecated!\n\nUse 'borderless_pickers' instead.",
3,
{ title = "cyberdream.nvim" }
)
end, 1000)
options.borderless_pickers = options.borderless_telescope
end
if options.theme then
vim.defer_fn(function()
vim.notify(
"The 'theme' table is deprecated!\n\nMove any 'theme' options to the main 'opts' table instead.",
3,
{ title = "cyberdream.nvim" }
)
end, 1000)
if options.theme.variant then
options.variant = options.theme.variant
end
if options.theme.saturation then
options.saturation = options.theme.saturation
end
if options.theme.colors then
options.colors = options.theme.colors
end
if options.theme.highlights then
options.highlights = options.theme.highlights
end
if options.theme.overrides then
options.overrides = options.theme.overrides
end
end
---@diagnostic enable: undefined-field
M.options = vim.tbl_deep_extend("force", {}, default_options, options)
vim.g.cyberdream_opts = M.options
end
M.setup()
return M