-
-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathconfig.lua
More file actions
143 lines (128 loc) 路 3.92 KB
/
Copy pathconfig.lua
File metadata and controls
143 lines (128 loc) 路 3.92 KB
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
local M = {}
---@class cyberdream.Highlight
---@field fg? string
---@field bg? string
---@field sp? string
---@field bold? boolean
---@field italic? boolean
---@field underline? boolean
---@field strikethrough? boolean
---@alias Colors table<cyberdream.Palette|string, string>
---@alias cyberdream.OverrideFn fun(palette: cyberdream.Palette): cyberdream.Highlight
---@alias cyberdream.Variant "default" | "light" | "muted" | "auto"
---@class cyberdream.Extensions
---@field default? boolean Set all extensions to this value by default (useful for disabling all except specific ones)
---@field alpha? boolean
---@field blinkcmp? boolean
---@field cmp? boolean
---@field dapui? 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 cyberdream.Config
---@field transparent? boolean
---@field variant? cyberdream.Variant
---@field saturation? number
---@field colors? cyberdream.Palette | table <cyberdream.Variant, cyberdream.Palette>
---@field highlights? table<string, cyberdream.Highlight>
---@field overrides? cyberdream.OverrideFn
---@field italic_comments? boolean
---@field hide_fillchars? boolean
---@field borderless_pickers? boolean
---@field terminal_colors? boolean
---@field cache? boolean
---@field extensions? cyberdream.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,
dapui = 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 cyberdream.Config
M.options = {}
---@param options cyberdream.Config|nil
function M.setup(options)
options = options or {}
-- Handle the special 'default' option in extensions
if options.extensions and options.extensions.default ~= nil then
local default_value = options.extensions.default
local user_extensions = vim.deepcopy(options.extensions)
user_extensions.default = nil -- Remove the special 'default' key
-- Start with all extensions set to the default value
local extensions = {}
for k, _ in pairs(default_options.extensions) do
extensions[k] = default_value
end
-- Then apply user-specified overrides
for k, v in pairs(user_extensions) do
extensions[k] = v
end
options.extensions = extensions
end
M.options = vim.tbl_deep_extend("force", {}, default_options, options)
vim.g.cyberdream_opts = M.options
end
M.setup()
return M