return { "stevearc/conform.nvim", event = { "BufReadPre", "BufNewFile" }, cmd = { "ConformInfo", "Format" }, opts = { formatters = { sqlfluff = { -- By default, SQLFluff uses "ansi" formatting. My projects -- right now use MySQL formatting instead. -- Still looking for a better way to manage this. args = { "fix", "--force", "--dialect=mysql", "-" }, }, }, formatters_by_ft = { lua = { "stylua" }, -- Ruff LSP handles formatting for Python code -- -- Multiple items in one table will be run sequentially python = { "ruff_format" }, c = { "clang-format" }, css = { "prettierd" }, html = { "prettierd" }, javascript = { "prettierd" }, json = { "prettierd" }, markdown = { "prettierd" }, typescript = { "prettierd" }, yaml = { "prettierd" }, sql = { "sqlfluff" }, }, }, config = function(_, opts) local conform = require("conform") require("conform").setup(opts) local function format() conform.format({ async = true, lsp_fallback = true }) end vim.keymap.set({ "n", "v" }, "rf", format, { desc = "Reformat" }) vim.api.nvim_create_user_command("Format", format, {}) end, }