Skip to content

Commit

Permalink
perf(cmp.nvim): less is more
Browse files Browse the repository at this point in the history
  • Loading branch information
liubang committed Jun 28, 2023
1 parent dcd5c70 commit a817502
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ return {
},
window = {
documentation = false,
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
},
formatting = {
fields = { "menu", "abbr", "kind" },
fields = { "abbr", "kind" },
format = function(entry, item)
if vim.tbl_contains({ "path" }, entry.source.name) then
local icon, hl_group = require("nvim-web-devicons").get_icon(entry:get_completion_item().label)
Expand All @@ -106,7 +107,7 @@ return {
return item
end
end
item.menu = item_map[entry.source.name] or entry.source.name
-- item.menu = item_map[entry.source.name] or entry.source.name
item.kind = string.format("%s %-9s", kind_icons[item.kind], item.kind)
return item
end,
Expand Down

0 comments on commit a817502

Please sign in to comment.