diff --git a/lua/configs/conform.lua b/lua/configs/conform.lua index 13ac260..be89d77 100644 --- a/lua/configs/conform.lua +++ b/lua/configs/conform.lua @@ -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 fm. + default_format_opts = { + timeout_ms = 1000, + lsp_format = "fallback", + }, } return options diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 81cf733..ab3ba20 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,7 +1,7 @@ return { { "stevearc/conform.nvim", - event = "BufWritePre", + cmd = "ConformInfo", opts = require "configs.conform", }, }