Given that lspkind just altered their interface, was looking for fixes for it's icons - I think the docs there could do with updating.
Anyway, during that investigation I figured out how to do mini.icons for both files and lsp:
local get_mini_icon = function(ctx)
if vim.tbl_contains({ "Path" }, ctx.source_name) then
local is_unknown_type = vim.tbl_contains(
{ "link", "socket", "fifo", "char", "block", "unknown" },
ctx.item.data.type
)
local mini_icon, mini_hl, _ = require("mini.icons").get(
is_unknown_type and "os" or ctx.item.data.type,
is_unknown_type and "" or ctx.label
)
if mini_icon then
return mini_icon, mini_hl
end
end
local mini_icon, mini_hl, _ = require("mini.icons").get("lsp", ctx.kind)
return mini_icon, mini_hl
end
require("blink.cmp").setup({
-- ...
completion = {
menu = {
draw = {
components = {
kind_icon = {
text = function(ctx)
local mini_icon, _mini_hl = get_mini_icon(ctx)
return mini_icon
end,
highlight = function(ctx)
local _mini_icon, mini_hl = get_mini_icon(ctx)
return mini_hl
end,
},
kind = {
-- (optional) use highlights from mini.icons
highlight = function(ctx)
local _mini_icon, mini_hl = get_mini_icon(ctx)
return mini_hl
end,
},
},
},
},
},
-- ...
})
Feature Description
Given that lspkind just altered their interface, was looking for fixes for it's icons - I think the docs there could do with updating.
Anyway, during that investigation I figured out how to do mini.icons for both files and lsp:
This renders paths with the file icon and everything else with lsp icons
May be interesting for the docs?