mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 08:35:53 +02:00
80 lines
1.6 KiB
Lua
80 lines
1.6 KiB
Lua
|
---@type LazyVimConfig
|
||
|
local M = {}
|
||
|
|
||
|
---@class LazyVimConfig
|
||
|
local defaults = {
|
||
|
icons = {
|
||
|
diagnostics = {
|
||
|
Error = " ",
|
||
|
Warn = " ",
|
||
|
Hint = " ",
|
||
|
Info = " ",
|
||
|
},
|
||
|
git = {
|
||
|
added = " ",
|
||
|
modified = " ",
|
||
|
removed = " ",
|
||
|
},
|
||
|
kinds = {
|
||
|
Array = " ",
|
||
|
Boolean = " ",
|
||
|
Class = " ",
|
||
|
Color = " ",
|
||
|
Constant = " ",
|
||
|
Constructor = " ",
|
||
|
Enum = " ",
|
||
|
EnumMember = " ",
|
||
|
Event = " ",
|
||
|
Field = " ",
|
||
|
File = " ",
|
||
|
Folder = " ",
|
||
|
Function = " ",
|
||
|
Interface = " ",
|
||
|
Key = " ",
|
||
|
Keyword = " ",
|
||
|
Method = " ",
|
||
|
Module = " ",
|
||
|
Namespace = " ",
|
||
|
Null = "ﳠ ",
|
||
|
Number = " ",
|
||
|
Object = " ",
|
||
|
Operator = " ",
|
||
|
Package = " ",
|
||
|
Property = " ",
|
||
|
Reference = " ",
|
||
|
Snippet = " ",
|
||
|
String = " ",
|
||
|
Struct = " ",
|
||
|
Text = " ",
|
||
|
TypeParameter = " ",
|
||
|
Unit = " ",
|
||
|
Value = " ",
|
||
|
Variable = " ",
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
|
||
|
---@type LazyVimConfig
|
||
|
local options
|
||
|
|
||
|
---@param opts? LazyVimConfig
|
||
|
function M.setup(opts)
|
||
|
options = vim.tbl_deep_extend("force", defaults, opts or {})
|
||
|
---@param range? string
|
||
|
function M.has(range)
|
||
|
local Semver = require("lazy.manage.semver")
|
||
|
return Semver.range(range or M.lazy_version):matches(require("lazy.core.config").version or "0.0.0")
|
||
|
end
|
||
|
|
||
|
setmetatable(M, {
|
||
|
__index = function(_, key)
|
||
|
if options == nil then
|
||
|
M.setup()
|
||
|
end
|
||
|
---@cast options LazyVimConfig
|
||
|
return options[key]
|
||
|
end,
|
||
|
})
|
||
|
|
||
|
return M
|