summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrahmajit Das <listout@listout.xyz>2025-09-04 12:10:18 +0530
committerBrahmajit Das <listout@listout.xyz>2025-09-04 12:10:18 +0530
commit43a792eda503f0d60fd887ab10b434568ff27074 (patch)
tree24e234dd7b435b310d3a3749cf9669a5c9a1566b
parent83caa6865ed951559123f664a5aeaeeabdcc70dd (diff)
lua: plugins: completion: use lspkind
Signed-off-by: Brahmajit Das <listout@listout.xyz>
-rw-r--r--lua/plugins/completion.lua18
1 files changed, 13 insertions, 5 deletions
diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua
index e869758..65f0923 100644
--- a/lua/plugins/completion.lua
+++ b/lua/plugins/completion.lua
@@ -17,6 +17,7 @@ return {
dependencies = "nvim-lua/plenary.nvim"
},
{ "micangl/cmp-vimtex" },
+ { "onsails/lspkind.nvim" },
{
"hrsh7th/nvim-cmp",
config = function()
@@ -59,6 +60,8 @@ return {
-- nvim-cmp setup
local cmp = require 'cmp'
+ local lspkind = require('lspkind')
+
cmp.setup {
view = {
docs = {
@@ -66,11 +69,16 @@ return {
},
},
formatting = {
- fields = { "kind", "abbr" },
- format = function(_, vim_item)
- vim_item.kind = cmp_kinds[vim_item.kind] or ""
- return vim_item
- end,
+ format = lspkind.cmp_format({
+ mode = "symbol_text",
+ menu = ({
+ buffer = "[Buffer]",
+ nvim_lsp = "[LSP]",
+ luasnip = "[LuaSnip]",
+ nvim_lua = "[Lua]",
+ latex_symbols = "[Latex]",
+ })
+ }),
},
snippet = {
expand = function(args)