update dotfiles

This commit is contained in:
2026-07-19 20:39:54 +08:00
parent aef001a855
commit 88c9035c43
18 changed files with 337 additions and 294 deletions
+81 -81
View File
@@ -1,54 +1,54 @@
@media -moz-pref("userChrome.theme-material") { @media -moz-pref("userChrome.theme-material") {
:root { :root {
--md-sys-color-primary: #216487; --md-sys-color-primary: #0d6680;
--md-sys-color-surface-tint: #216487; --md-sys-color-surface-tint: #0d6680;
--md-sys-color-on-primary: #ffffff; --md-sys-color-on-primary: #ffffff;
--md-sys-color-primary-container: #c6e7ff; --md-sys-color-primary-container: #baeaff;
--md-sys-color-on-primary-container: #001e2d; --md-sys-color-on-primary-container: #001f29;
--md-sys-color-secondary: #4f616e; --md-sys-color-secondary: #4c616b;
--md-sys-color-on-secondary: #ffffff; --md-sys-color-on-secondary: #ffffff;
--md-sys-color-secondary-container: #d2e5f4; --md-sys-color-secondary-container: #cfe6f1;
--md-sys-color-on-secondary-container: #0b1d28; --md-sys-color-on-secondary-container: #071e26;
--md-sys-color-tertiary: #62597c; --md-sys-color-tertiary: #5c5b7e;
--md-sys-color-on-tertiary: #ffffff; --md-sys-color-on-tertiary: #ffffff;
--md-sys-color-tertiary-container: #e8ddff; --md-sys-color-tertiary-container: #e2dfff;
--md-sys-color-on-tertiary-container: #1e1635; --md-sys-color-on-tertiary-container: #181837;
--md-sys-color-error: #ba1a1a; --md-sys-color-error: #ba1a1a;
--md-sys-color-on-error: #ffffff; --md-sys-color-on-error: #ffffff;
--md-sys-color-error-container: #ffdad6; --md-sys-color-error-container: #ffdad6;
--md-sys-color-on-error-container: #410002; --md-sys-color-on-error-container: #410002;
--md-sys-color-background: #f6fafe; --md-sys-color-background: #f5fafd;
--md-sys-color-on-background: #181c1f; --md-sys-color-on-background: #171c1f;
--md-sys-color-surface: #f6fafe; --md-sys-color-surface: #f5fafd;
--md-sys-color-on-surface: #181c1f; --md-sys-color-on-surface: #171c1f;
--md-sys-color-surface-variant: #dde3ea; --md-sys-color-surface-variant: #dce4e8;
--md-sys-color-on-surface-variant: #41484d; --md-sys-color-on-surface-variant: #40484c;
--md-sys-color-outline: #71787e; --md-sys-color-outline: #70787d;
--md-sys-color-outline-variant: #c1c7ce; --md-sys-color-outline-variant: #c0c8cc;
--md-sys-color-shadow: #000000; --md-sys-color-shadow: #000000;
--md-sys-color-scrim: #000000; --md-sys-color-scrim: #000000;
--md-sys-color-inverse-surface: #2d3135; --md-sys-color-inverse-surface: #2c3134;
--md-sys-color-inverse-on-surface: #eef1f6; --md-sys-color-inverse-on-surface: #edf1f5;
--md-sys-color-inverse-primary: #92cef5; --md-sys-color-inverse-primary: #89d0ee;
--md-sys-color-primary-fixed: #c6e7ff; --md-sys-color-primary-fixed: #baeaff;
--md-sys-color-on-primary-fixed: #001e2d; --md-sys-color-on-primary-fixed: #001f29;
--md-sys-color-primary-fixed-dim: #92cef5; --md-sys-color-primary-fixed-dim: #89d0ee;
--md-sys-color-on-primary-fixed-variant: #004c6b; --md-sys-color-on-primary-fixed-variant: #004d62;
--md-sys-color-secondary-fixed: #d2e5f4; --md-sys-color-secondary-fixed: #cfe6f1;
--md-sys-color-on-secondary-fixed: #0b1d28; --md-sys-color-on-secondary-fixed: #071e26;
--md-sys-color-secondary-fixed-dim: #b6c9d8; --md-sys-color-secondary-fixed-dim: #b4cad5;
--md-sys-color-on-secondary-fixed-variant: #374955; --md-sys-color-on-secondary-fixed-variant: #354a53;
--md-sys-color-tertiary-fixed: #e8ddff; --md-sys-color-tertiary-fixed: #e2dfff;
--md-sys-color-on-tertiary-fixed: #1e1635; --md-sys-color-on-tertiary-fixed: #181837;
--md-sys-color-tertiary-fixed-dim: #ccc1e9; --md-sys-color-tertiary-fixed-dim: #c4c3ea;
--md-sys-color-on-tertiary-fixed-variant: #4a4263; --md-sys-color-on-tertiary-fixed-variant: #444465;
--md-sys-color-surface-dim: #d7dadf; --md-sys-color-surface-dim: #d6dbde;
--md-sys-color-surface-bright: #f6fafe; --md-sys-color-surface-bright: #f5fafd;
--md-sys-color-surface-container-lowest: #ffffff; --md-sys-color-surface-container-lowest: #ffffff;
--md-sys-color-surface-container-low: #f0f4f8; --md-sys-color-surface-container-low: #f0f4f7;
--md-sys-color-surface-container: #f6fafe; --md-sys-color-surface-container: #f5fafd;
--md-sys-color-surface-container-high: #f6fafe; --md-sys-color-surface-container-high: #f5fafd;
--md-sys-color-surface-container-highest: #f6fafe; --md-sys-color-surface-container-highest: #f5fafd;
--m3-radius: 12px; --m3-radius: 12px;
--m3-radius-sm: 10px; --m3-radius-sm: 10px;
@@ -71,55 +71,55 @@
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--md-sys-color-primary: #92cef5; --md-sys-color-primary: #89d0ee;
--md-sys-color-surface-tint: #92cef5; --md-sys-color-surface-tint: #89d0ee;
--md-sys-color-on-primary: #00344b; --md-sys-color-on-primary: #003545;
--md-sys-color-primary-container: #004c6b; --md-sys-color-primary-container: #004d62;
--md-sys-color-on-primary-container: #c6e7ff; --md-sys-color-on-primary-container: #baeaff;
--md-sys-color-secondary: #b6c9d8; --md-sys-color-secondary: #b4cad5;
--md-sys-color-on-secondary: #21323e; --md-sys-color-on-secondary: #1e333c;
--md-sys-color-secondary-container: #374955; --md-sys-color-secondary-container: #354a53;
--md-sys-color-on-secondary-container: #d2e5f4; --md-sys-color-on-secondary-container: #cfe6f1;
--md-sys-color-tertiary: #ccc1e9; --md-sys-color-tertiary: #c4c3ea;
--md-sys-color-on-tertiary: #332b4b; --md-sys-color-on-tertiary: #2d2d4d;
--md-sys-color-tertiary-container: #4a4263; --md-sys-color-tertiary-container: #444465;
--md-sys-color-on-tertiary-container: #e8ddff; --md-sys-color-on-tertiary-container: #e2dfff;
--md-sys-color-error: #ffb4ab; --md-sys-color-error: #ffb4ab;
--md-sys-color-on-error: #690005; --md-sys-color-on-error: #690005;
--md-sys-color-error-container: #93000a; --md-sys-color-error-container: #93000a;
--md-sys-color-on-error-container: #ffdad6; --md-sys-color-on-error-container: #ffdad6;
--md-sys-color-background: #101417; --md-sys-color-background: #0f1417;
--md-sys-color-on-background: #dfe3e7; --md-sys-color-on-background: #dee3e6;
--md-sys-color-surface: #101417; --md-sys-color-surface: #0f1417;
--md-sys-color-on-surface: #dfe3e7; --md-sys-color-on-surface: #dee3e6;
--md-sys-color-surface-variant: #41484d; --md-sys-color-surface-variant: #40484c;
--md-sys-color-on-surface-variant: #c1c7ce; --md-sys-color-on-surface-variant: #c0c8cc;
--md-sys-color-outline: #8b9198; --md-sys-color-outline: #8a9296;
--md-sys-color-outline-variant: #41484d; --md-sys-color-outline-variant: #40484c;
--md-sys-color-shadow: #000000; --md-sys-color-shadow: #000000;
--md-sys-color-scrim: #000000; --md-sys-color-scrim: #000000;
--md-sys-color-inverse-surface: #dfe3e7; --md-sys-color-inverse-surface: #dee3e6;
--md-sys-color-inverse-on-surface: #2d3135; --md-sys-color-inverse-on-surface: #2c3134;
--md-sys-color-inverse-primary: #216487; --md-sys-color-inverse-primary: #0d6680;
--md-sys-color-primary-fixed: #c6e7ff; --md-sys-color-primary-fixed: #baeaff;
--md-sys-color-on-primary-fixed: #001e2d; --md-sys-color-on-primary-fixed: #001f29;
--md-sys-color-primary-fixed-dim: #92cef5; --md-sys-color-primary-fixed-dim: #89d0ee;
--md-sys-color-on-primary-fixed-variant: #004c6b; --md-sys-color-on-primary-fixed-variant: #004d62;
--md-sys-color-secondary-fixed: #d2e5f4; --md-sys-color-secondary-fixed: #cfe6f1;
--md-sys-color-on-secondary-fixed: #0b1d28; --md-sys-color-on-secondary-fixed: #071e26;
--md-sys-color-secondary-fixed-dim: #b6c9d8; --md-sys-color-secondary-fixed-dim: #b4cad5;
--md-sys-color-on-secondary-fixed-variant: #374955; --md-sys-color-on-secondary-fixed-variant: #354a53;
--md-sys-color-tertiary-fixed: #e8ddff; --md-sys-color-tertiary-fixed: #e2dfff;
--md-sys-color-on-tertiary-fixed: #1e1635; --md-sys-color-on-tertiary-fixed: #181837;
--md-sys-color-tertiary-fixed-dim: #ccc1e9; --md-sys-color-tertiary-fixed-dim: #c4c3ea;
--md-sys-color-on-tertiary-fixed-variant: #4a4263; --md-sys-color-on-tertiary-fixed-variant: #444465;
--md-sys-color-surface-dim: #101417; --md-sys-color-surface-dim: #0f1417;
--md-sys-color-surface-bright: #353a3d; --md-sys-color-surface-bright: #353a3d;
--md-sys-color-surface-container-lowest: #0a0f12; --md-sys-color-surface-container-lowest: #0a0f11;
--md-sys-color-surface-container-low: #181c1f; --md-sys-color-surface-container-low: #171c1f;
--md-sys-color-surface-container: #1c2024; --md-sys-color-surface-container: #1b2023;
--md-sys-color-surface-container-high: #262a2e; --md-sys-color-surface-container-high: #252b2d;
--md-sys-color-surface-container-highest: #313539; --md-sys-color-surface-container-highest: #303638;
--m3-elev-1: 0 1px 2px color-mix(in srgb, var(--md-sys-color-shadow) 50%, transparent), 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 35%, transparent); --m3-elev-1: 0 1px 2px color-mix(in srgb, var(--md-sys-color-shadow) 50%, transparent), 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 35%, transparent);
--m3-elev-2: 0 4px 10px color-mix(in srgb, var(--md-sys-color-shadow) 55%, transparent), 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 35%, transparent); --m3-elev-2: 0 4px 10px color-mix(in srgb, var(--md-sys-color-shadow) 55%, transparent), 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 35%, transparent);
+4
View File
@@ -60,6 +60,7 @@
"blurEnabled": false, "blurEnabled": false,
"blurForegroundLayers": true, "blurForegroundLayers": true,
"blurLayerOutlineOpacity": 0.12, "blurLayerOutlineOpacity": 0.12,
"blurBorderEnabled": true,
"blurBorderColor": "outline", "blurBorderColor": "outline",
"blurBorderCustomColor": "#ffffff", "blurBorderCustomColor": "#ffffff",
"blurBorderOpacity": 0.35, "blurBorderOpacity": 0.35,
@@ -509,6 +510,7 @@
"notificationOverlayEnabled": false, "notificationOverlayEnabled": false,
"notificationPopupShadowEnabled": true, "notificationPopupShadowEnabled": true,
"notificationPopupPrivacyMode": false, "notificationPopupPrivacyMode": false,
"notificationForegroundLayers": true,
"modalDarkenBackground": true, "modalDarkenBackground": true,
"lockScreenShowPowerActions": true, "lockScreenShowPowerActions": true,
"lockScreenShowSystemIcons": true, "lockScreenShowSystemIcons": true,
@@ -526,6 +528,8 @@
"lockPamPath": "", "lockPamPath": "",
"lockPamInlineFprint": false, "lockPamInlineFprint": false,
"lockPamInlineU2f": false, "lockPamInlineU2f": false,
"lockPamExternallyManaged": false,
"lockU2fPamPath": "",
"lockScreenInactiveColor": "#000000", "lockScreenInactiveColor": "#000000",
"lockScreenNotificationMode": 0, "lockScreenNotificationMode": 0,
"lockScreenVideoEnabled": false, "lockScreenVideoEnabled": false,
+6 -6
View File
@@ -5,16 +5,16 @@ tab_bar_align left
tab_bar_min_tabs 2 tab_bar_min_tabs 2
tab_bar_margin_width 0.0 tab_bar_margin_width 0.0
tab_bar_margin_height 2.5 1.5 tab_bar_margin_height 2.5 1.5
tab_bar_margin_color #101417 tab_bar_margin_color #0f1417
tab_bar_background #101417 tab_bar_background #0f1417
active_tab_foreground #00344b active_tab_foreground #003545
active_tab_background #92cef5 active_tab_background #89d0ee
active_tab_font_style bold active_tab_font_style bold
inactive_tab_foreground #c1c7ce inactive_tab_foreground #c0c8cc
inactive_tab_background #101417 inactive_tab_background #0f1417
inactive_tab_font_style normal inactive_tab_font_style normal
tab_activity_symbol " ● " tab_activity_symbol " ● "
+21 -21
View File
@@ -1,25 +1,25 @@
cursor #dfe3e7 cursor #dee3e6
cursor_text_color #c1c7ce cursor_text_color #c0c8cc
foreground #dfe3e7 foreground #dee3e6
background #101417 background #0f1417
selection_foreground #21323e selection_foreground #1e333c
selection_background #b6c9d8 selection_background #b4cad5
url_color #92cef5 url_color #89d0ee
color0 #101417 color0 #0f1417
color1 #ff729e color1 #ff72a0
color2 #7af589 color2 #77ee84
color3 #fff672 color3 #fff672
color4 #77bce8 color4 #6ebfe2
color5 #1d5071 color5 #18546e
color6 #92cef5 color6 #89d0ee
color7 #eff8ff color7 #eaf5f9
color8 #939a9f color8 #8f979a
color9 #ff9fbd color9 #ff9fbe
color10 #a5ffb0 color10 #a5ffaf
color11 #fff9a5 color11 #fff9a5
color12 #a7dcff color12 #a3e3ff
color13 #b6e2ff color13 #b3e8ff
color14 #d0ecff color14 #cef0ff
color15 #f8fcff color15 #f8fdff
+8 -8
View File
@@ -5,14 +5,14 @@ layout {
background-color "transparent" background-color "transparent"
focus-ring { focus-ring {
active-color "#92cef5" active-color "#89d0ee"
inactive-color "#8b9198" inactive-color "#8a9296"
urgent-color "#ffb4ab" urgent-color "#ffb4ab"
} }
border { border {
active-color "#92cef5" active-color "#89d0ee"
inactive-color "#8b9198" inactive-color "#8a9296"
urgent-color "#ffb4ab" urgent-color "#ffb4ab"
} }
@@ -21,19 +21,19 @@ layout {
} }
tab-indicator { tab-indicator {
active-color "#92cef5" active-color "#89d0ee"
inactive-color "#8b9198" inactive-color "#8a9296"
urgent-color "#ffb4ab" urgent-color "#ffb4ab"
} }
insert-hint { insert-hint {
color "#92cef580" color "#89d0ee80"
} }
} }
recent-windows { recent-windows {
highlight { highlight {
active-color "#004c6b" active-color "#004d62"
urgent-color "#ffb4ab" urgent-color "#ffb4ab"
} }
} }
-3
View File
@@ -1,9 +1,6 @@
-- ============================================================================= -- =============================================================================
-- init.lua — Neovim 入口文件 -- init.lua — Neovim 入口文件
-- ============================================================================= -- =============================================================================
-- 【结构变更】原 init.lua 中 options + keymaps + lazy 全部内联,
-- 现拆分为 config/options.lua + config/keymaps.lua + config/lazy.lua 三层,
-- 更利于 :Lazy reload 和后续维护。
require("config.options") require("config.options")
require("config.keymaps") require("config.keymaps")
require("config.lazy") require("config.lazy")
+91 -19
View File
@@ -12,36 +12,53 @@ vim.g.maplocalleader = " "
keymap("n", "<leader>w", "<cmd>w<cr>", { desc = "保存" }) keymap("n", "<leader>w", "<cmd>w<cr>", { desc = "保存" })
-- 关闭当前 buffer / 窗口(VSCode 风格) -- 关闭当前 buffer / 窗口(VSCode 风格)
-- - quickfix 窗口:cclosecmake-tools 输出窗口)
-- - 普通文件:统计文件 buffer 数量
-- - 只剩 1 个文件 buffer → 退出 nvim(不留下 "no name" 空白)
-- - 多个文件 buffer → Bdelete 关闭当前标签
-- - 其他特殊 buffer(终端等):直接关闭窗口
keymap("n", "<leader>q", function() keymap("n", "<leader>q", function()
local bt = vim.bo.buftype local bt = vim.bo.buftype
local ft = vim.bo.filetype local ft = vim.bo.filetype
if bt == "quickfix" then -- 统计文件 buffer 数量
vim.cmd("cclose")
return
end
if bt ~= "" then
vim.cmd("close")
return
end
-- 统计文件 buffer 数量(排除 nvim-tree/dashboard/quickfix/terminal 等)
local file_bufs = 0 local file_bufs = 0
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_loaded(bufnr) then if vim.api.nvim_buf_is_loaded(bufnr) then
local b = vim.bo[bufnr] local b = vim.bo[bufnr]
if b.buftype == "" and b.filetype ~= "" then if b.buftype == "" and b.filetype ~= "" and b.filetype ~= "NvimTree" and b.filetype ~= "dashboard" then
file_bufs = file_bufs + 1 file_bufs = file_bufs + 1
end end
end end
end end
-- dashboard:无文件直接退出
if ft == "dashboard" then
vim.cmd("qa")
return
end
-- nvim-tree:有文件关闭树,无文件退出
if ft == "NvimTree" then
if file_bufs == 0 then
vim.cmd("qa")
else
vim.cmd("NvimTreeClose")
end
return
end
-- quickfixcclose
if bt == "quickfix" then
vim.cmd("cclose")
return
end
-- 其他特殊 buffer:关闭窗口(失败则退出)
if bt ~= "" then
local ok = pcall(vim.cmd, "close")
if not ok then
vim.cmd("qa")
end
return
end
-- 普通文件:根据数量决定退出或关闭
if file_bufs <= 1 then if file_bufs <= 1 then
vim.cmd("qa") vim.cmd("qa")
else else
@@ -63,8 +80,62 @@ keymap("n", "<leader>sh", "<cmd>split<cr>", { desc = "水平分屏" })
keymap("n", "<leader>sc", "<cmd>close<cr>", { desc = "关闭窗口" }) keymap("n", "<leader>sc", "<cmd>close<cr>", { desc = "关闭窗口" })
-- Buffer 导航 -- Buffer 导航
keymap("n", "<S-h>", "<cmd>bnext<cr>", { desc = "下一个 buffer" }) keymap("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "下一个 buffer" })
keymap("n", "<S-l>", "<cmd>bprevious<cr>", { desc = "上一个 buffer" }) keymap("n", "<S-l>", "<cmd>bnext<cr>", { desc = "上一个 buffer" })
-- Buffer 操作
keymap("n", "<leader>bc", "<cmd>Bdelete<cr>", { desc = "关闭当前 buffer" })
keymap("n", "<leader>bs", "<cmd>wall<cr>", { desc = "保存全部" })
keymap("n", "<leader>bo", function()
local current = vim.api.nvim_get_current_buf()
local special_ft = { NvimTree = true, dashboard = true, [""] = true }
-- 检查是否有未保存的文件 buffer
local unsaved = {}
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_loaded(bufnr) then
local ft = vim.bo[bufnr].filetype
local bt = vim.bo[bufnr].buftype
-- 只统计普通文件 buffer
if bt == "" and not special_ft[ft] and bufnr ~= current then
if vim.bo[bufnr].modified then
table.insert(unsaved, bufnr)
end
end
end
end
local function close_others(force)
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_loaded(bufnr) and bufnr ~= current then
local ft = vim.bo[bufnr].filetype
local bt = vim.bo[bufnr].buftype
-- 只关闭普通文件 buffer,保留 nvim-tree/dashboard 等
if bt == "" and not special_ft[ft] then
vim.api.nvim_buf_delete(bufnr, { force = force })
end
end
end
end
if #unsaved > 0 then
vim.ui.select({ "保存全部", "强制关闭(不保存)", "取消" }, { prompt = "" .. #unsaved .. " 个未保存的 buffer" }, function(choice)
if not choice then return end
if choice == "保存全部" then
for _, bufnr in ipairs(unsaved) do
vim.api.nvim_buf_call(bufnr, function()
vim.cmd("write")
end)
end
close_others(false)
elseif choice == "强制关闭(不保存)" then
close_others(true)
end
end)
else
close_others(false)
end
end, { desc = "关闭其他 buffer" })
-- 文件树 -- 文件树
keymap("n", "<leader>e", "<cmd>NvimTreeToggle<cr>", { desc = "文件树" }) keymap("n", "<leader>e", "<cmd>NvimTreeToggle<cr>", { desc = "文件树" })
@@ -72,3 +143,4 @@ keymap("n", "<leader>e", "<cmd>NvimTreeToggle<cr>", { desc = "文件树" })
-- 终端 -- 终端
keymap("n", "<c-`>", "<cmd>ToggleTerm<cr>", { desc = "终端" }) keymap("n", "<c-`>", "<cmd>ToggleTerm<cr>", { desc = "终端" })
keymap("t", "<c-`>", "<cmd>ToggleTerm<cr>", { desc = "终端" }) keymap("t", "<c-`>", "<cmd>ToggleTerm<cr>", { desc = "终端" })
+5 -10
View File
@@ -1,11 +1,6 @@
-- ============================================================================= -- =============================================================================
-- lazy.lua — 插件管理器初始化 -- lazy.lua — 插件管理器初始化
-- ============================================================================= -- =============================================================================
-- 【来源】从原 init.lua 提取。
-- 【修改】🔧 install.colorscheme 改为 tokyonight(你的主题);
-- 🔧 添加 ui.border = "rounded" 统一圆角;
-- 🔧 添加 performance.rtp 禁用内置插件提升启动速度。
-- 【修复】🔧 defaults.lazy = true(保留你的原设置),但 UI 核心插件不懒加载。
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then if not vim.uv.fs_stat(lazypath) then
@@ -22,28 +17,28 @@ require("lazy").setup({
{ import = "plugins" }, { import = "plugins" },
}, },
-- 🔧 修复:保留你的 defaults.lazy = true -- 默认延迟加载插件
defaults = { defaults = {
lazy = true, lazy = true,
}, },
-- 🔧 修改:安装时尝试加载的主题 -- 安装时尝试加载的主题
install = { install = {
colorscheme = { "tokyonight", "habamax" }, colorscheme = { "tokyonight", "habamax" },
}, },
-- 🔧 修改:关闭自动检查更新(你的原设置),但保留手动 :Lazy check -- 关闭自动检查更新(手动 :Lazy check
checker = { checker = {
enabled = false, enabled = false,
notify = false, notify = false,
}, },
-- 🔧 修改:统一 UI 圆角边框 -- 统一 UI 圆角边框
ui = { ui = {
border = "rounded", border = "rounded",
}, },
-- ✅ 新增:禁用内置插件提升启动速度 -- 禁用内置插件提升启动速度
performance = { performance = {
rtp = { rtp = {
disabled_plugins = { disabled_plugins = {
+20 -23
View File
@@ -1,8 +1,6 @@
-- ============================================================================= -- =============================================================================
-- options.lua — 编辑器基础选项 -- options.lua — 编辑器基础选项
-- ============================================================================= -- =============================================================================
-- 【来源】从原 init.lua 提取,补充了参考配置中缺失的选项。
-- 【新增项】已用 ✅ 标注,【修改项】已用 🔧 标注。
local opt = vim.opt local opt = vim.opt
@@ -10,15 +8,15 @@ local opt = vim.opt
-- 行号 -- 行号
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
opt.number = true -- 当前行绝对行号 opt.number = true -- 当前行绝对行号
opt.relativenumber = true -- 相对行号(保留你的设置,方便 5j/5k 跳转) opt.relativenumber = true -- 相对行号
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 缩进 -- 缩进
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
opt.tabstop = 4 -- Tab 宽度 4(保留你的设置,适配 C/C++ opt.tabstop = 4 -- Tab 宽度
opt.shiftwidth = 4 -- 缩进宽度 4 opt.shiftwidth = 4 -- 缩进宽度
opt.expandtab = true -- Tab 转空格 opt.expandtab = true -- Tab 转空格
opt.autoindent = true -- ✅ 新增:新行继承上一行缩进 opt.autoindent = true -- 新行继承上一行缩进
opt.smartindent = true -- 智能缩进 opt.smartindent = true -- 智能缩进
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
@@ -26,8 +24,8 @@ opt.smartindent = true -- 智能缩进
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
opt.ignorecase = true -- 搜索忽略大小写 opt.ignorecase = true -- 搜索忽略大小写
opt.smartcase = true -- 含大写字母时区分大小写 opt.smartcase = true -- 含大写字母时区分大小写
opt.hlsearch = true -- ✅ 新增:高亮搜索匹配 opt.hlsearch = true -- 高亮搜索匹配
opt.incsearch = true -- ✅ 新增:实时预览搜索 opt.incsearch = true -- 实时预览搜索
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 显示 & 界面 -- 显示 & 界面
@@ -36,11 +34,11 @@ opt.termguicolors = true -- 真彩色
opt.cursorline = true -- 高亮当前行 opt.cursorline = true -- 高亮当前行
opt.signcolumn = "yes" -- 始终显示符号列 opt.signcolumn = "yes" -- 始终显示符号列
opt.wrap = false -- 不自动换行 opt.wrap = false -- 不自动换行
opt.scrolloff = 8 -- ✅ 新增:光标距上下边缘保持 8 行 opt.scrolloff = 8 -- 光标距上下边缘保持 8 行
opt.sidescrolloff = 8 -- ✅ 新增:光标距左右边缘保持 8 列 opt.sidescrolloff = 8 -- 光标距左右边缘保持 8 列
opt.showmode = false -- ✅ 新增:隐藏 --INSERT--(状态栏会显示) opt.showmode = false -- 隐藏模式提示(状态栏会显示)
opt.pumheight = 10 -- 补全菜单最大高度 opt.pumheight = 10 -- 补全菜单最大高度
opt.winborder = "rounded" -- 全局浮动窗口圆角(保留你的设置) opt.winborder = "rounded" -- 全局浮动窗口圆角
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 分割窗口 -- 分割窗口
@@ -51,16 +49,16 @@ opt.splitbelow = true -- 水平分割在下方
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 文件 & 编码 -- 文件 & 编码
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
opt.encoding = "utf-8" -- ✅ 新增:显式指定 UTF-8 opt.encoding = "utf-8" -- 文件编码
opt.fileencoding = "utf-8" -- ✅ 新增 opt.fileencoding = "utf-8"
opt.swapfile = false -- ✅ 新增:关闭交换文件 opt.swapfile = false -- 关闭交换文件
opt.backup = false -- ✅ 新增:关闭备份文件 opt.backup = false -- 关闭备份文件
opt.undofile = true -- 持久化撤销 opt.undofile = true -- 持久化撤销
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 鼠标 & 剪贴板 -- 鼠标 & 剪贴板
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
opt.mouse = "a" -- ✅ 新增:所有模式启用鼠标 opt.mouse = "a" -- 所有模式启用鼠标
opt.clipboard = "unnamedplus" -- 系统剪贴板 opt.clipboard = "unnamedplus" -- 系统剪贴板
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
@@ -74,18 +72,17 @@ opt.wildmode = "longest:full,full"
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 补全 -- 补全
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 🔧 修改:completeopt 改为 blink.cmp 推荐配置 opt.completeopt = { "menuone", "noselect" } -- blink.cmp 推荐配置
opt.completeopt = { "menuone", "noselect" }
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 折叠(为 nvim-ufo 准备) -- 折叠(为 nvim-ufo 准备)
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
opt.foldlevel = 99 opt.foldlevel = 99
opt.foldlevelstart = 99 -- ✅ 新增:启动时展开所有折叠 opt.foldlevelstart = 99 -- 启动时展开所有折叠
opt.foldenable = true -- ✅ 新增:启用折叠 opt.foldenable = true -- 启用折叠
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
-- 其他 -- 其他
-- ───────────────────────────────────────────── -- ─────────────────────────────────────────────
opt.conceallevel = 0 -- ✅ 新增:不隐藏特殊字符 opt.conceallevel = 0 -- 不隐藏特殊字符
opt.isfname:append("@-@") -- ✅ 新增:文件名识别 @ 符号 opt.isfname:append("@-@") -- 文件名识别 @ 符号
+1 -3
View File
@@ -1,15 +1,13 @@
-- ============================================================================= -- =============================================================================
-- autopairs.lua — 自动括号补全 -- autopairs.lua — 自动括号补全
-- ============================================================================= -- =============================================================================
-- 【保留】你的配置。
-- 【修改】🔧 添加 check_ts = true 让括号补全感知 Treesitter 语法。
return { return {
{ {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
event = "InsertEnter", event = "InsertEnter",
opts = { opts = {
check_ts = true, -- 🔧 新增:Treesitter 感知,避免在字符串/注释里自动配对 check_ts = true, -- Treesitter 感知,避免在字符串/注释里自动配对
}, },
}, },
} }
-2
View File
@@ -1,8 +1,6 @@
-- ============================================================================= -- =============================================================================
-- cmake-tools.lua — CMake 工具 -- cmake-tools.lua — CMake 工具
-- ============================================================================= -- =============================================================================
-- 【保留】你的完整 cmake-tools 配置。
-- 【无修改】不改动任何已有逻辑。
return { return {
{ {
-5
View File
@@ -1,9 +1,6 @@
-- ============================================================================= -- =============================================================================
-- conform.lua — 自动格式化 -- conform.lua — 自动格式化
-- ============================================================================= -- =============================================================================
-- 【保留】你的完整 conform 配置。
-- 【修改】🔧 键位从 <leader>cf 改为 <leader>lf(与 LSP 格式化键统一);
-- ✅ 新增更多语言的 formatter。
return { return {
{ {
@@ -11,7 +8,6 @@ return {
event = { "BufWritePre" }, event = { "BufWritePre" },
cmd = { "ConformInfo" }, cmd = { "ConformInfo" },
keys = { keys = {
-- 🔧 修改:<leader>cf → <leader>lf,与 keymaps.lua 中的 LSP 格式化键一致
{ "<leader>lf", function() require("conform").format({ async = true, lsp_fallback = true }) end, desc = "格式化" }, { "<leader>lf", function() require("conform").format({ async = true, lsp_fallback = true }) end, desc = "格式化" },
}, },
opts = { opts = {
@@ -24,7 +20,6 @@ return {
lua = { "stylua" }, lua = { "stylua" },
c = { "clang-format" }, c = { "clang-format" },
cpp = { "clang-format" }, cpp = { "clang-format" },
-- ✅ 新增:更多语言
python = { "black", "isort" }, python = { "black", "isort" },
javascript = { "prettier" }, javascript = { "prettier" },
typescript = { "prettier" }, typescript = { "prettier" },
+1 -3
View File
@@ -1,8 +1,6 @@
-- ============================================================================= -- =============================================================================
-- git.lua — Git 集成 -- git.lua — Git 集成
-- ============================================================================= -- =============================================================================
-- 【保留】你的 gitsigns + diffview 配置完整保留。
-- 【新增】✅ lazygit 集成(参考配置有,你缺的)。
return { return {
@@ -79,7 +77,7 @@ return {
}, },
}, },
-- ✅ 新增:lazygit 集成 -- lazygit: Git TUI
{ {
"kdheepak/lazygit.nvim", "kdheepak/lazygit.nvim",
cmd = { "LazyGit", "LazyGitCurrentFile" }, cmd = { "LazyGit", "LazyGitCurrentFile" },
-2
View File
@@ -1,8 +1,6 @@
-- ============================================================================= -- =============================================================================
-- oil.lua — 文件浏览器 -- oil.lua — 文件浏览器
-- ============================================================================= -- =============================================================================
-- 【保留】你的完整 oil.nvim 配置。
-- 【无修改】oil 作为默认文件浏览器不变。
return { return {
{ {
+1 -3
View File
@@ -1,8 +1,6 @@
-- ============================================================================= -- =============================================================================
-- runner.lua — 统一构建/运行/调试分发器 -- runner.lua — 统一构建/运行/调试分发器
-- ============================================================================= -- =============================================================================
-- 【保留】你的 runner.lua 配置和 keymap 完整保留。
-- 【无修改】这是你的优秀设计,不需要改动。
return { return {
{ {
@@ -13,7 +11,7 @@ return {
{ "<F10>", function() require("dap").step_over() end, desc = "单步跳过" }, { "<F10>", function() require("dap").step_over() end, desc = "单步跳过" },
{ "<F11>", function() require("dap").step_into() end, desc = "单步进入" }, { "<F11>", function() require("dap").step_into() end, desc = "单步进入" },
{ "<F12>", function() require("dap").step_out() end, desc = "单步跳出" }, { "<F12>", function() require("dap").step_out() end, desc = "单步跳出" },
-- 🔧 修改:断点键位从 <leader>b 改为 <leader>db(避免与 buffer 分组冲突) -- 断点键位(避免与 buffer 分组冲突)
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "断点" }, { "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "断点" },
{ "<leader>du", function() require("dapui").toggle() end, desc = "调试界面" }, { "<leader>du", function() require("dapui").toggle() end, desc = "调试界面" },
+2 -5
View File
@@ -1,8 +1,6 @@
-- ============================================================================= -- =============================================================================
-- treesitter.lua — 语法高亮 -- treesitter.lua — 语法高亮与折叠
-- ============================================================================= -- =============================================================================
-- 【保留】你的完整 ensure_installed 列表。
-- 【新增】✅ fold 配置让 nvim-ufo 可以使用 treesitter 折叠。
return { return {
{ {
@@ -17,8 +15,7 @@ return {
}, },
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true }, indent = { enable = true },
-- ✅ 新增:启用 treesitter 折叠(nvim-ufo 依赖 fold = { enable = true }, -- nvim-ufo 依赖
fold = { enable = true },
}, },
}, },
} }
+1 -4
View File
@@ -1,9 +1,6 @@
-- ============================================================================= -- =============================================================================
-- whichkey.lua — 键位提示 -- whichkey.lua — 键位提示
-- ============================================================================= -- =============================================================================
-- 【修复】原配置 enabled = false 直接禁用了,现在启用。
-- 【修改】🔧 enabled 改为 true
-- 🔧 更完善的分组和图标配置。
return { return {
{ {
@@ -39,7 +36,7 @@ return {
local wk = require("which-key") local wk = require("which-key")
wk.setup(opts) wk.setup(opts)
-- ✅ 新增:键位分组提示 -- 键位分组提示
wk.add({ wk.add({
{ "<leader>e", group = "文件树" }, { "<leader>e", group = "文件树" },
{ "<leader>f", group = "搜索" }, { "<leader>f", group = "搜索" },
+1 -2
View File
@@ -1,8 +1,6 @@
-- ============================================================================= -- =============================================================================
-- runner.lua — 统一构建/运行/调试分发器 -- runner.lua — 统一构建/运行/调试分发器
-- ============================================================================= -- =============================================================================
-- 【保留】你的完整 runner.lua 模块。
-- 【修改】使用 quickfix 窗口显示输出,与 CMake 保持一致
local M = {} local M = {}
@@ -128,3 +126,4 @@ function M.test()
end end
return M return M