return { -- Autoformat 'stevearc/conform.nvim', event = { 'BufWritePre', 'BufReadPre', 'BufNewFile' }, cmd = { 'ConformInfo' }, keys = { { 'f', function() require('conform').format({ async = true, lsp_format = 'fallback' }) end, mode = '', desc = '[F]ormat buffer', }, }, opts = { notify_on_error = false, format_on_save = { lsp_fallback = true, async = false, timeout_ms = 500, }, formatters_by_ft = { lua = { 'stylua' }, javascript = { 'prettier' }, typescript = { 'prettier' }, javascriptreact = { 'prettier' }, typescriptreact = { 'prettier' }, svelte = { 'prettier' }, css = { 'prettier' }, html = { 'prettier' }, json = { 'prettier' }, yaml = { 'prettier' }, markdown = { 'prettier' }, graphql = { 'prettier' }, liquid = { 'prettier' }, python = { 'isort', 'black' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, }, }, }