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]", end,
})[entry.source.name] -- format = lspkind.cmp_format({
return vim_item -- with_text = true,
end, -- 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('/', {
@ -275,16 +297,16 @@ return {
'fgheng/winbar.nvim', 'fgheng/winbar.nvim',
config = function() config = function()
require('winbar').setup({ require('winbar').setup({
enabled = true, -- 是否启动winbar enabled = true, -- 是否启动winbar
-- show_file_path = true, -- 是否显示文件路径 -- show_file_path = true, -- 是否显示文件路径
show_symbols = true, -- 是否显示函数标签 show_symbols = true, -- 是否显示函数标签
-- 颜色配置,为空,将使用默认配色 -- 颜色配置,为空,将使用默认配色
colors = { colors = {
path = '#aaffff', -- 路径的颜色,比如#ababab path = '#aaffff', -- 路径的颜色,比如#ababab
file_name = '#bbbbff', -- 文件名称的颜色,比如#acacac file_name = '#bbbbff', -- 文件名称的颜色,比如#acacac
symbols = '', -- 函数颜色 symbols = '', -- 函数颜色
}, },
-- 图标配置 -- 图标配置