summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-08-28 07:45:08 +0530
committersinanmohd <sinan@firemail.cc>2023-08-28 07:58:01 +0530
commit06df1c699cd8243befa37a20620d8c9eca431bdd (patch)
tree00ae7d529f4ab6400a0d28e044bf7e0e215aa222
parenta8a46ebee6b26191cb382dc636d1cebab5de3e81 (diff)
config/nvim/cmp: icons init
-rw-r--r--.config/nvim/init.lua37
1 files changed, 36 insertions, 1 deletions
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
+ },
})