aboutsummaryrefslogtreecommitdiff
path: root/lua/prismite/groups/kinds.lua
blob: 69a25c2ecccd0f053f76f26398a5769603460c4d (plain)
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
local colors = require "prismite.palette"

local M = {}

M.base = {
    [""] = { fg = colors.blue },
    Text = { link = "__base__" },
    Method = { link = "@function.method" },
    Function = { link = "@function" },
    Constructor = { link = "@constructor" },
    Field = { link = "@variable.member" },
    Variable = { link = "@variable" },
    Class = { link = "@type" },
    Interface = { link = "@type" },
    Module = { link = "@module" },
    Property = { link = "@property" },
    Unit = { link = "@constant" },
    Value = { link = "__base__" },
    Enum = { link = "@type" },
    Keyword = { link = "@keyword" },
    Snippet = { link = "__base__" },
    Color = { link = "@string.special" },
    File = { link = "@string.special.path" },
    Reference = { link = "__base__" },
    Folder = { link = "@string.special.path" },
    EnumMember = { link = "@constant" },
    Constant = { link = "@constant" },
    Struct = { link = "@type" },
    Event = { link = "@constant" },
    Operator = { link = "@operator" },
    TypeParameter = { link = "@parameter" },
}

function M.generate(base)
    local ret = {}
    for kind, hl in pairs(M.base) do
        ret[base .. kind] =
            vim.tbl_deep_extend("force", hl, hl.link and { link = hl.link:gsub("__base__", base) } or {})
    end

    return ret
end

return M