Skip to content

Docs for mini.icons + mini.icons file icons + lspkind doc updates #2366

Description

@georgeharker

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:

    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,
                        },
                    },
                },
            },
        },
    -- ...
   })

This renders paths with the file icon and everything else with lsp icons

May be interesting for the docs?

Activity

  1. added a commit that references this issue on Mar 13, 2026
    4b8cfb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions