From b694b4bb05d7eac752d64b2cd39f7ea41f2d4687 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 15 Mar 2023 20:39:41 -0500 Subject: [PATCH] fix(nvim): fill in icons for missing ones in lspkind for cmp --- .../primary/config/lua/plugins/configs/_cmp.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dots/.nvim-environments/primary/config/lua/plugins/configs/_cmp.lua b/dots/.nvim-environments/primary/config/lua/plugins/configs/_cmp.lua index bf4ac29c..97a69c03 100755 --- a/dots/.nvim-environments/primary/config/lua/plugins/configs/_cmp.lua +++ b/dots/.nvim-environments/primary/config/lua/plugins/configs/_cmp.lua @@ -27,6 +27,10 @@ cmp.setup({ spell = { symbol = " ", name = "Spell", hl_group = "Spell" }, } + local extra_kind_icons = { + TypeParameter = "" + } + local selection = selections[entry.source.name] if not selection then local kind = require("lspkind").cmp_format({ @@ -34,8 +38,12 @@ cmp.setup({ maxwidth = 50, })(entry, vim_item) local strings = vim.split(kind.kind, "%s", { trimempty = true }) + if not strings[2] then + strings[2] = strings[1] + strings[1] = extra_kind_icons[strings[1]] or "" + end kind.kind = " " .. strings[1] .. " " - vim_item.menu = strings[1] .. " " .. strings[2] + vim_item.menu = (strings[1] or "") .. " " .. (strings[2] or "") return kind else local word = entry:get_insert_text()