From 06df1c699cd8243befa37a20620d8c9eca431bdd Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Mon, 28 Aug 2023 07:45:08 +0530 Subject: config/nvim/cmp: icons init --- .config/nvim/init.lua | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index e2afaf4..2481ec6 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -142,10 +142,45 @@ require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls()) lsp.setup() -- [[ cmp setup ]] +local kind_icons = { + 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 = " ", +} + require("cmp").setup({ sources = { { name = "nvim_lsp" }, { name = "buffer" }, { name = "path" }, - } + }, + formatting = { + format = function(entry, vim_item) + vim_item.kind = kind_icons[vim_item.kind] .. " " .. string.lower(vim_item.kind) + vim_item.menu = "[" .. entry.source.name .. "]" + return vim_item + end + }, }) -- cgit v1.2.3