This commit is contained in:
newbie 2023-12-18 23:31:37 +08:00
parent 9499019de5
commit eed785a3e6

View File

@ -133,7 +133,8 @@ return {
}
require("symbols-outline").setup(opts)
G.map({
{ "n", "<cs-o>", "<cmd>SymbolsOutline<cr>" },
{ "n", "<cs-o>", "<cmd>SymbolsOutline<cr>", { noremap = true } },
{ "v", "<cs-o>", "<cmd>SymbolsOutline<cr>", { noremap = true } },
})
end
},
@ -187,21 +188,42 @@ return {
end, { "i", "s" }),
}),
window = {
completion = {
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
col_offset = -3,
side_padding = 0,
border = "rounded",
scrollbar = true,
},
documentation = {
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
border = "rounded",
scrollbar = true,
},
},
fomatting = {
format = lspkind.cmp_format({
with_text = true,
maxwidth = 50,
mode = 'symbol',
before = function(entry, vim_item)
vim_item.kind = kind_icons[vim_item.kind]
vim_item.menu = ({
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
})[entry.source.name]
return vim_item
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = " " .. (strings[1] or "") .. " "
kind.menu = " (" .. (strings[2] or "") .. ")"
return kind
end,
})
-- format = lspkind.cmp_format({
-- with_text = true,
-- maxwidth = 50,
-- mode = 'symbol',
-- before = function(entry, vim_item)
-- vim_item.kind = kind_icons[vim_item.kind]
-- vim_item.menu = ({
-- buffer = "[Buffer]",
-- nvim_lsp = "[LSP]",
-- })[entry.source.name]
-- return vim_item
-- end,
-- })
},
}
cmp.setup.cmdline('/', {