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) require("symbols-outline").setup(opts)
G.map({ 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 end
}, },
@ -187,21 +188,42 @@ return {
end, { "i", "s" }), end, { "i", "s" }),
}), }),
window = { 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 = { fomatting = {
format = lspkind.cmp_format({ fields = { "kind", "abbr", "menu" },
with_text = true, format = function(entry, vim_item)
maxwidth = 50, local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
mode = 'symbol', local strings = vim.split(kind.kind, "%s", { trimempty = true })
before = function(entry, vim_item) kind.kind = " " .. (strings[1] or "") .. " "
vim_item.kind = kind_icons[vim_item.kind] kind.menu = " (" .. (strings[2] or "") .. ")"
vim_item.menu = ({
buffer = "[Buffer]", return kind
nvim_lsp = "[LSP]",
})[entry.source.name]
return vim_item
end, 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('/', { cmp.setup.cmdline('/', {