feat: VSCode 风格 Neovim 配置
- 分层架构:config/{options,keymaps,lazy} + plugins/
- 保留:blink.cmp, oil.nvim, runner.lua, cmake-tools, diffview, tokyonight
- 新增 UI:bufferline, lualine, noice, nvim-notify, dashboard, dressing
- 新增编辑器:Comment, nvim-surround, vim-illuminate, toggleterm, flash
- 新增视觉:indent-blankline, nvim-ufo, rainbow-delimiters
- 新增 Git:lazygit 集成
- 新增 DAP:persistent-breakpoints, nvim-dap-virtual-text
- 修复:which-key 启用, rustaceanvim 填充, 键位冲突解决
- 语法检查:22/22 文件全部通过 luajit -b
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
-- =============================================================================
|
||||
-- conform.lua — 自动格式化
|
||||
-- =============================================================================
|
||||
-- 【保留】你的完整 conform 配置。
|
||||
-- 【修改】🔧 键位从 <leader>cf 改为 <leader>lf(与 LSP 格式化键统一);
|
||||
-- ✅ 新增更多语言的 formatter。
|
||||
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
-- 🔧 修改:<leader>cf → <leader>lf,与 keymaps.lua 中的 LSP 格式化键一致
|
||||
{ "<leader>lf", function() require("conform").format({ async = true, lsp_fallback = true }) end, desc = "格式化" },
|
||||
},
|
||||
opts = {
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
formatters_by_ft = {
|
||||
rust = { "rustfmt" },
|
||||
lua = { "stylua" },
|
||||
c = { "clang-format" },
|
||||
cpp = { "clang-format" },
|
||||
-- ✅ 新增:更多语言
|
||||
python = { "black", "isort" },
|
||||
javascript = { "prettier" },
|
||||
typescript = { "prettier" },
|
||||
json = { "prettier" },
|
||||
yaml = { "prettier" },
|
||||
markdown = { "prettier" },
|
||||
html = { "prettier" },
|
||||
css = { "prettier" },
|
||||
go = { "gofmt", "goimports" },
|
||||
sh = { "shfmt" },
|
||||
},
|
||||
formatters = {
|
||||
["clang-format"] = {
|
||||
args = { "--style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never, ColumnLimit: 0}" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user