refactor(nvim): 完整重写配置,支持 Go/Rust/Python/TypeScript 开发

- 架构重构:新增 plugins/lang/ 子目录,按语言拆分配置
- 补全引擎:nvim-cmp → blink.cmp + LuaSnip
- 文件浏览:新增 neo-tree(<Space>e)
- 语言支持:
  - Go: ray-x/go.nvim + dap-go + neotest-go
  - Rust: rustaceanvim + crates.nvim
  - Python: venv-selector + dap-python + neotest-python
  - TypeScript: typescript-tools.nvim(替换 ts_ls)
- LSP: lazydev + mason + mason-lspconfig + fidget + inc-rename
- 格式化: conform.nvim(lsp_format fallback,保存时自动格式化)
- Lint: nvim-lint(selene 替换 luacheck,Mason 可直接安装)
- UI: snacks.nvim(dashboard+notifier+picker)+ noice + lualine + bufferline
- 编辑增强: mini.ai + mini.surround + grug-far + flash + ufo + trouble v3
- 删除废弃文件: cmp/coding/null-ls/mason/lspconfig/go/python 等旧文件
- 修复: Neovim 0.12 treesitter query 校验报错(noice routes 过滤)
- 新增: NVIM_GUIDE.md 快捷键使用手册

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-04-07 16:55:07 +08:00
parent 2aa176dff5
commit 6fd5d96043
36 changed files with 2087 additions and 2814 deletions

View File

@@ -1,101 +1,63 @@
-- colorscheme.lua - 主题配置
return {
-- 主题Tokyo Night
{
"folke/tokyonight.nvim",
lazy = false, -- 不延迟加载主题
priority = 1000, -- 确保先加载主题
config = function()
require("tokyonight").setup({
style = "night", -- 可选值:"storm", "moon", "night", "day"
transparent = false, -- 启用背景透明
terminal_colors = true, -- 设置终端颜色
styles = {
comments = { italic = true },
keywords = { italic = true },
functions = {},
variables = {},
sidebars = "dark",
floats = "dark",
},
sidebars = { "qf", "help", "terminal", "packer", "NvimTree", "Trouble" },
dim_inactive = false, -- 非活动窗口变暗
lualine_bold = true, -- 在状态栏中使用粗体
on_highlights = function(hl, c)
-- 自定义高亮组
hl.CursorLineNr = { fg = c.orange, bold = true }
hl.LineNr = { fg = c.orange, bold = false }
hl.LineNrAbove = { fg = c.fg_gutter }
hl.LineNrBelow = { fg = c.fg_gutter }
-- 浮动窗口
hl.NormalFloat = { bg = c.bg_dark }
hl.FloatBorder = { bg = c.bg_dark, fg = c.blue }
end,
})
-- 加载主题
lazy = false,
priority = 1000,
opts = {
style = "night",
transparent = false,
terminal_colors = true,
styles = {
comments = { italic = true },
keywords = { italic = true },
functions = {},
variables = {},
sidebars = "dark",
floats = "dark",
},
sidebars = { "qf", "help", "terminal", "Trouble", "neo-tree" },
dim_inactive = false,
lualine_bold = true,
on_highlights = function(hl, c)
hl.CursorLineNr = { fg = c.orange, bold = true }
hl.LineNr = { fg = c.orange, bold = false }
hl.LineNrAbove = { fg = c.fg_gutter }
hl.LineNrBelow = { fg = c.fg_gutter }
hl.NormalFloat = { bg = c.bg_dark }
hl.FloatBorder = { bg = c.bg_dark, fg = c.blue }
end,
},
config = function(_, opts)
require("tokyonight").setup(opts)
vim.cmd.colorscheme("tokyonight")
end
end,
},
-- 替代主题Catppuccin
{
"catppuccin/nvim",
name = "catppuccin",
lazy = true, -- 懒加载此主题
lazy = true,
opts = {
flavour = "mocha", -- 风格: latte, frappe, macchiato, mocha
flavour = "mocha",
term_colors = true,
transparent_background = false,
styles = {
comments = { "italic" },
conditionals = { "italic" },
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = {},
properties = {},
types = {},
operators = {},
},
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
treesitter = true,
mason = true,
telescope = {
enabled = true,
style = "nvchad",
},
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
},
telescope = { enabled = true },
native_lsp = { enabled = true },
blink_cmp = true,
},
},
},
-- 图标支持
{
"nvim-tree/nvim-web-devicons",
lazy = true,
},
}
}