From 8c649c09bad8772a7029c9a0cd1a6651b096a9d8 Mon Sep 17 00:00:00 2001 From: krolyxon Date: Wed, 7 Sep 2022 22:12:37 +0530 Subject: [PATCH] nvim cmp icons --- lua/plugins/configs/cmp.lua | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/lua/plugins/configs/cmp.lua b/lua/plugins/configs/cmp.lua index 814330e..c34ac5c 100644 --- a/lua/plugins/configs/cmp.lua +++ b/lua/plugins/configs/cmp.lua @@ -43,6 +43,53 @@ local options = { require("luasnip").lsp_expand(args.body) end, }, + + formatting = { + format = function(_, vim_item) + local icons = { + Namespace = "", + Text = " ", + Method = " ", + Function = " ", + Constructor = " ", + Field = "ﰠ ", + Variable = " ", + Class = "ﴯ ", + Interface = " ", + Module = " ", + Property = "ﰠ ", + Unit = "塞 ", + Value = " ", + Enum = " ", + Keyword = " ", + Snippet = " ", + Color = " ", + File = " ", + Reference = " ", + Folder = " ", + EnumMember = " ", + Constant = " ", + Struct = "פּ ", + Event = " ", + Operator = " ", + TypeParameter = " ", + Table = "", + Object = " ", + Tag = "", + Array = "[]", + Boolean = " ", + Number = " ", + Null = "ﳠ", + String = " ", + Calendar = "", + Watch = " ", + Package = "", + } + vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind) + return vim_item + end, + }, + mapping = { [""] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.select_next_item(),