fix(pack): 修正 logo 变量名 logs -> logos\nfeat(lsp): 添加 <leader>cr 重命名符号快捷键

This commit is contained in:
xfy 2026-05-29 10:06:27 +08:00
parent aa00138ffb
commit f12f0f110b
2 changed files with 8 additions and 3 deletions

View File

@ -51,7 +51,7 @@ vim.pack.add({
-- 展示 Neovim ASCII Logo 和启动耗时统计。 -- 展示 Neovim ASCII Logo 和启动耗时统计。
-- ASCII art 集合(用于启动页等展示) -- ASCII art 集合(用于启动页等展示)
local logs = { local logos = {
a = { a = {
"⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷", "⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷",
"⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇", "⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇",
@ -178,7 +178,7 @@ local all_modules = {
-- 计算 Logo 的最大显示宽度,用于页脚居中计算 -- 计算 Logo 的最大显示宽度,用于页脚居中计算
local max_header_width = 0 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)) max_header_width = math.max(max_header_width, vim.fn.strdisplaywidth(line))
end end
@ -186,7 +186,7 @@ starter.setup({
autoopen = true, -- 无参数启动时自动打开 autoopen = true, -- 无参数启动时自动打开
evaluate_single = false, -- 只有一个选项时不自动执行 evaluate_single = false, -- 只有一个选项时不自动执行
items = { { name = " ", action = "", section = "" } }, -- 空选项(仅展示页眉页脚) items = { { name = " ", action = "", section = "" } }, -- 空选项(仅展示页眉页脚)
header = table.concat(logs.f, "\n"), -- Logo 文本 header = table.concat(logos.f, "\n"), -- Logo 文本
-- 页脚函数:显示启动耗时和模块加载统计 -- 页脚函数:显示启动耗时和模块加载统计
footer = function() footer = function()

View File

@ -168,6 +168,11 @@ vim.keymap.set("n", "<leader>ca", function()
vim.lsp.buf.code_action() vim.lsp.buf.code_action()
end, { desc = "代码操作" }) end, { desc = "代码操作" })
-- <leader>cr - Rename重命名光标下的符号
vim.keymap.set("n", "<leader>cr", function()
vim.lsp.buf.rename()
end, { desc = "重命名符号" })
-- --------------------------------------------------------------------------- -- ---------------------------------------------------------------------------
-- 诊断导航 -- 诊断导航
-- --------------------------------------------------------------------------- -- ---------------------------------------------------------------------------