Skip to content

Commit

Permalink
Merge pull request #31 from cbaconnier/fix-cmp-icon
Browse files Browse the repository at this point in the history
Fix potential issue with cmp
  • Loading branch information
RicardoRamirezR authored Oct 25, 2024
2 parents 8b6ccc2 + 1756afa commit 3db8376
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion lua/blade-nav/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3db8376

Please sign in to comment.