初始化dotfiles

This commit is contained in:
2026-06-18 11:36:12 +08:00
commit f4305709a5
37 changed files with 1540 additions and 0 deletions

View File

@ -0,0 +1,32 @@
-- ============================================================================
-- 自动格式化 (conform.nvim)
-- 保存时自动格式化,手动 <leader>cf 触发
-- ============================================================================
return {
{
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{ "<leader>cf", function() require("conform").format({ async = 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" },
},
formatters = {
["clang-format"] = {
args = { "--style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never, ColumnLimit: 0}" },
},
},
},
},
}