diff --git a/lua/plugs/nvim-lspconfig.lua b/lua/plugs/nvim-lspconfig.lua index 15a5b47..44cf33c 100644 --- a/lua/plugs/nvim-lspconfig.lua +++ b/lua/plugs/nvim-lspconfig.lua @@ -133,7 +133,8 @@ return { } require("symbols-outline").setup(opts) G.map({ - { "n", "", "SymbolsOutline" }, + { "n", "", "SymbolsOutline", { noremap = true } }, + { "v", "", "SymbolsOutline", { 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 - end, - }) + 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('/', { @@ -275,16 +297,16 @@ return { 'fgheng/winbar.nvim', config = function() require('winbar').setup({ - enabled = true, -- 是否启动winbar + enabled = true, -- 是否启动winbar -- show_file_path = true, -- 是否显示文件路径 show_symbols = true, -- 是否显示函数标签 -- 颜色配置,为空,将使用默认配色 colors = { - path = '#aaffff', -- 路径的颜色,比如#ababab + path = '#aaffff', -- 路径的颜色,比如#ababab file_name = '#bbbbff', -- 文件名称的颜色,比如#acacac - symbols = '', -- 函数颜色 + symbols = '', -- 函数颜色 }, -- 图标配置