return { { 'stevearc/conform.nvim', event = { 'BufWritePre' }, cmd = { 'ConformInfo' }, keys = { { 'fo', function() require('conform').format { async = true, lsp_fallback = true } end, mode = '', desc = '[Fo]rmat Buffer', }, }, opts = { notify_on_error = false, format_on_save = function(bufnr) local disable_filetypes = { c = true, cpp = true, sh = true } return { timeout_ms = 500, lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], } end, formatters_by_ft = { lua = { 'stylua' }, python = { 'pyright', 'isort', 'black' }, md = { 'prettier' }, nix = { 'nixfmt' }, yaml = { 'yamlfmt' }, sh = { 'shfmt' }, }, }, }, }