diff --git a/README.md b/README.md index 528254a..6e992d4 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,31 @@ vim.g.blade_nav = { See `:h VIMINIT` +## Customization with nvim-cmp + +If you want to add an icon to blade-nav completion items in cmp, you can configure it through nvim-cmp's formatting options: + +``` +local kind_icons = { + BladeNav = "", +} + +local cmp = require('cmp') + +cmp.setup({ + formatting = { + format = function(entry, item) + + if kind_icons[item.kind] then + item.kind = string.format('%s %s', kind_icons[item.kind], item.kind) + end + + return item + end + }, +}) +``` + ## Health To check the health of the plugin, run `:checkhealth blade-nav`. diff --git a/lua/blade-nav/cmp.lua b/lua/blade-nav/cmp.lua index 974cc86..1f86908 100644 --- a/lua/blade-nav/cmp.lua +++ b/lua/blade-nav/cmp.lua @@ -50,7 +50,7 @@ M.setup = function(opts) label = name.label, cmp = { kind_hl_group = "CmpItemKindBladeNav", - kind_text = " " .. " blade-nav", + kind_text = "BladeNav", }, textEdit = { newText = name.newText,