mirror of
https://github.com/d0zingcat/dotfiles.git
synced 2026-05-13 15:09:34 +00:00
- 架构重构:新增 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>
40 lines
1.1 KiB
Lua
40 lines
1.1 KiB
Lua
-- lint.lua - 代码静态检查(nvim-lint)
|
||
|
||
return {
|
||
{
|
||
"mfussenegger/nvim-lint",
|
||
event = { "BufReadPre", "BufNewFile" },
|
||
config = function()
|
||
local lint = require("lint")
|
||
|
||
lint.linters_by_ft = {
|
||
python = { "ruff" },
|
||
lua = { "selene" },
|
||
go = { "golangcilint" },
|
||
javascript = { "eslint_d" },
|
||
typescript = { "eslint_d" },
|
||
javascriptreact = { "eslint_d" },
|
||
typescriptreact = { "eslint_d" },
|
||
markdown = { "markdownlint" },
|
||
yaml = { "yamllint" },
|
||
dockerfile = { "hadolint" },
|
||
sh = { "shellcheck" },
|
||
bash = { "shellcheck" },
|
||
}
|
||
|
||
local lint_augroup = vim.api.nvim_create_augroup("nvim_lint", { clear = true })
|
||
|
||
vim.api.nvim_create_autocmd({ "BufWritePost", "BufReadPost", "InsertLeave" }, {
|
||
group = lint_augroup,
|
||
callback = function()
|
||
lint.try_lint()
|
||
end,
|
||
})
|
||
|
||
vim.api.nvim_create_user_command("Lint", function()
|
||
lint.try_lint()
|
||
end, { desc = "手动触发代码检查" })
|
||
end,
|
||
},
|
||
}
|