refactor(conform): format on demand, not on save

Agents run stylua/biome/rustfmt themselves, and a save-time reformat
races their in-flight writes to the same buffer. Timeout and LSP
fallback move to default_format_opts so <leader>fm (NvChad's binding)
keeps the same behaviour; conform now lazy-loads on first use.

Drops the /contrib/ skip — explicit invocation is already the opt-in.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
naps62
2026-08-17 09:07:19 +00:00
co-authored by Claude Opus 5
parent bec6a2f7ef
commit 6795920741
2 changed files with 7 additions and 12 deletions
+6 -11
View File
@@ -20,17 +20,12 @@ local options = {
},
},
format_after_save = function()
local buf_path = vim.api.nvim_buf_get_name(0)
if buf_path:find "/contrib/" then
return nil
end
return {
timeout_ms = 1000,
lsp_format = "fallback",
}
end,
-- No format-on-save: agents run these formatters themselves, and a save-time
-- reformat races their in-flight writes. Format on demand with <leader>fm.
default_format_opts = {
timeout_ms = 1000,
lsp_format = "fallback",
},
}
return options
+1 -1
View File
@@ -1,7 +1,7 @@
return {
{
"stevearc/conform.nvim",
event = "BufWritePre",
cmd = "ConformInfo",
opts = require "configs.conform",
},
}