Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lua/modules/configs/completion/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ return function()
vim_item.kind =
string.format(" %s %s", lspkind_icons[vim_item.kind] or icons.cmp.undefined, vim_item.kind or "")

-- set up labels for completion entries
vim_item.menu = setmetatable({
cmp_tabnine = "[TN]",
copilot = "[CPLT]",
Expand All @@ -109,12 +110,18 @@ return function()
end,
})[entry.source.name]

-- cut down long results
local label = vim_item.abbr
local truncated_label = vim.fn.strcharpart(label, 0, 80)
if truncated_label ~= label then
vim_item.abbr = truncated_label .. "..."
end

-- deduplicate results from nvim_lsp
if entry.source.name == "nvim_lsp" then
vim_item.dup = 0
end

return vim_item
end,
},
Expand Down