nvim: cmp style
This commit is contained in:
parent
7a1aecf89c
commit
1a6fe3ab86
@ -19,15 +19,22 @@ cmp.setup({
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
-- completion = cmp.config.window.bordered(),
|
completion = {
|
||||||
-- documentation = cmp.config.window.bordered(),
|
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||||
|
col_offset = -3,
|
||||||
|
side_padding = 0,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
format = require("lspkind").cmp_format {
|
fields = { "kind", "abbr", "menu" },
|
||||||
mode = "symbol_text", -- 顯示圖示+文字
|
format = function(entry, vim_item)
|
||||||
maxwidth = 50,
|
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
|
||||||
ellipsis_char = "...",
|
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||||
},
|
kind.kind = " " .. (strings[1] or "") .. " "
|
||||||
|
kind.menu = " (" .. (strings[2] or "") .. ")"
|
||||||
|
|
||||||
|
return kind
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user