vim.pack.add({ gh("stevearc/conform.nvim") }) require("conform").setup({ default_format_opts = { lsp_format = "fallback", async = true }, formatters_by_ft = { rust = { "rustfmt" }, lua = { "stylua" }, markdown = { "prettier" }, makefile = { "bake" }, c = { "clang-format" }, cpp = { "clang-format" }, bash = { "beautysh" } }, }) vim.keymap.set({ "n", "x" }, "lf", function() require("conform").format() end, { desc = "conform format" }) vim.api.nvim_create_autocmd("BufWritePre", { pattern = "*", callback = function(args) require("conform").format({ bufnr = args.buf }) end, })