Make view nicer

This commit is contained in:
2024-07-26 07:42:31 +02:00
parent e1711a1180
commit 9c504e284f
5 changed files with 30 additions and 38 deletions

View File

@@ -54,11 +54,12 @@ cmp.setup({
{ name = "path" },
{ name = "nvim_lsp", keyword_length = 2 },
{ name = "nvim_lsp_signature_help" },
-- { name = "nvim_lua", keyword_length = 2 },
{ name = "nvim_lua", keyword_length = 2 },
{ name = "buffer", keyword_length = 2 },
{ name = "calc" },
{ name = "lua-latex-symbols", option = { cache = true } },
{ name = "cmp_tabnine", keyword_length = 3 },
{ name = "cmp_tabnine", keyword_length = 20 },
{ name = "fuzzy_buffer", keyword_length = 4 },
}),
-- add formatting of the different sources
@@ -67,13 +68,12 @@ cmp.setup({
format = function(entry, item)
local menu_icon = {
nvim_lsp = "λ",
-- ultisnips = "⋗",
path = "🌐",
path = "󰴠",
calc = "Σ",
buffer = "📚",
lualatexsymbols = "𝕋",
spell = "📚",
fuzzy_buffer = "📄",
buffer = "",
lualatexsymbols = "󰿈",
spell = "󰘝",
fuzzy_buffer = "",
cmp_tabnine = "🖳",
}
item.menu = menu_icon[entry.source.name]
@@ -82,26 +82,19 @@ cmp.setup({
},
})
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = "buffer" },
}),
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
{ name = "fuzzy_path", keyword_length = 4 },
},
formatting = {
fields = { "menu", "abbr", "kind" },
format = function(entry, item)
local menu_icon = {
buffer = "📚",
buffer = "󰱼",
fuzzy_path = "",
}
item.menu = menu_icon[entry.source.name]
return item
@@ -114,17 +107,17 @@ cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
{ name = "cmdline_history", keyword_length = 8 },
{ name = "cmdline_history", keyword_length = 24 },
}, {
{ name = "cmdline" },
{ name = "cmdline", keyword_length = 1 },
}),
formatting = {
fields = { "menu", "abbr", "kind" },
format = function(entry, item)
local menu_icon = {
path = "🌐",
cmdline = "💻",
cmdline_history = "📰",
path = "󰙅",
cmdline = "",
cmdline_history = "󰂺 ",
}
item.menu = menu_icon[entry.source.name]
return item