return { "stevearc/conform.nvim", event = { "BufReadPre", "BufNewFile" }, config = function() local conform = require("conform") conform.setup({ formatters_by_ft = { lua = { "stylua" }, go = { "goimports", "gofmt" }, javascript = { "prettierd" }, typescript = { "prettierd" }, vue = { "prettierd" }, css = { "prettierd" }, html = { "prettierd" }, markdown = { "prettierd" }, json = { "fixjson" }, rust = { "rustfmt" }, shell = { "shfmt", "shellcheck" }, python = { "isort", "black" }, php = { "phpcbf", "php_cs_fixer" }, blade = { "blade-formatter" } }, log_level = vim.log.levels.WARN, notify_on_error = false, }) vim.keymap.set({ "n", "v" }, "F", function() conform.format({ lsp_fallback = true, async = false, timeout_ms = 500, }) end) vim.fn.mkdir(vim.fn.expand("~/.cache/php-cs-fixer"), "p") conform.formatters.php_cs_fixer = { prepend_args = { "--config=" .. vim.fn.expand("~/.config/php-cs-fixer.php"), "--cache-file=" .. vim.fn.expand("~/.cache/php-cs-fixer/cache"), }, env = { PHP_CS_FIXER_IGNORE_ENV = "1", }, } conform.formatters.phpcbf = { prepend_args = { "--standard=~/.config/phpcs.xml" }, } end, }