[nvim] refactor: trim down lsp icons + remove unused functions

This commit is contained in:
David JULIEN 2022-05-01 18:30:12 +02:00
parent f0596d3c80
commit 375f82d8e6

View File

@ -46,16 +46,6 @@ local icons = {
Variable = "", Variable = "",
} }
local function icons_setup()
local kinds = vim.lsp.protocol.CompletionItemKind
for i, kind in ipairs(kinds) do
kinds[i] = icons[kind] or kind
end
end
cmp.setup { cmp.setup {
completion = { completion = {
autocomplete = false autocomplete = false
@ -72,7 +62,8 @@ cmp.setup {
}, },
formatting = { formatting = {
format = function(entry, vim_item) format = function(entry, vim_item)
vim_item.kind = icons[vim_item.kind] vim_item.kind = string.format("%s %s", icons[vim_item.kind],
vim_item.kind)
vim_item.menu = ({ vim_item.menu = ({
nvim_lsp = "[lsp]", nvim_lsp = "[lsp]",
nvim_lua = "[nvim]", nvim_lua = "[nvim]",
@ -119,5 +110,8 @@ cmp.setup {
fallback() fallback()
end end
end, { "i", "s" }), end, { "i", "s" }),
} },
view = {
entries = {name = 'custom', selection_order = 'near_cursor' }
},
} }