From f12f0f110b3bec9cf7b5c2231c69e4658365acd1 Mon Sep 17 00:00:00 2001 From: xfy Date: Fri, 29 May 2026 10:06:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(pack):=20=E4=BF=AE=E6=AD=A3=20logo=20?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=90=8D=20logs=20->=20logos\nfeat(lsp):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20cr=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/pack.lua | 6 +++--- lua/plugins/lsp.lua | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lua/pack.lua b/lua/pack.lua index b858fe5..541c7fc 100644 --- a/lua/pack.lua +++ b/lua/pack.lua @@ -51,7 +51,7 @@ vim.pack.add({ -- 展示 Neovim ASCII Logo 和启动耗时统计。 -- ASCII art 集合(用于启动页等展示) -local logs = { +local logos = { a = { "⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷", "⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇", @@ -178,7 +178,7 @@ local all_modules = { -- 计算 Logo 的最大显示宽度,用于页脚居中计算 local max_header_width = 0 -for _, line in ipairs(logs.f) do +for _, line in ipairs(logos.f) do max_header_width = math.max(max_header_width, vim.fn.strdisplaywidth(line)) end @@ -186,7 +186,7 @@ starter.setup({ autoopen = true, -- 无参数启动时自动打开 evaluate_single = false, -- 只有一个选项时不自动执行 items = { { name = " ", action = "", section = "" } }, -- 空选项(仅展示页眉页脚) - header = table.concat(logs.f, "\n"), -- Logo 文本 + header = table.concat(logos.f, "\n"), -- Logo 文本 -- 页脚函数:显示启动耗时和模块加载统计 footer = function() diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 59f1d31..83668e4 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -168,6 +168,11 @@ vim.keymap.set("n", "ca", function() vim.lsp.buf.code_action() end, { desc = "代码操作" }) +-- cr - Rename:重命名光标下的符号 +vim.keymap.set("n", "cr", function() + vim.lsp.buf.rename() +end, { desc = "重命名符号" }) + -- --------------------------------------------------------------------------- -- 诊断导航 -- ---------------------------------------------------------------------------