return { "stevearc/conform.nvim", event = { "BufWritePre" }, cmd = { "ConformInfo" }, keys = { { "lf", function() require("conform").format({ async = true, lsp_format = "fallback" }) end, mode = "", desc = "[l]sp: [f]ormat buffer", }, }, opts = { notify_on_error = false, format_on_save = function(bufnr) local disable_filetypes = { c = true, cpp = true } if disable_filetypes[vim.bo[bufnr].filetype] then return nil else return { timeout_ms = 2500, lsp_format = "fallback", } end end, formatters_by_ft = { go = { "goimports", "gofmt" }, hcl = { "terragrunt_hclfmt" }, html = { "prettierd" }, javascript = { "prettierd" }, json = { "fixjson" }, lua = { "stylua" }, markdown = { "prettierd" }, ruby = { "rubocop" }, rust = { "rustfmt" }, sh = { "shellharden" }, swift = { "swiftformat" }, terraform = { "terraform_fmt" }, xml = { "xmllint" }, yaml = { "prettierd" }, }, formatters = {}, }, }