refactor(nvim): update conform formatters and enable format-on-save

Reorder rust formatters (rustfmt primary), switch python from
isort/black to ruff/dprint, and enable format_on_save with lsp_fallback.
This commit is contained in:
2026-08-05 18:22:34 -04:00
parent f5c484b801
commit 80698baf41
+9 -8
View File
@@ -21,8 +21,8 @@ conform.setup({
cpp = { "clang_format" }, cpp = { "clang_format" },
lua = { 'stylua' }, lua = { 'stylua' },
go = { "goimports", "gofmt" }, go = { "goimports", "gofmt" },
rust = { "dprint", "rustfmt", lsp_format = "fallback" }, rust = { "rustfmt", "dprint", lsp_format = "fallback" },
python = { "isort", "black", stop_after_first = true }, python = { "ruff", "dprint", stop_after_first = true },
javascript = { "dprint", "prettier", stop_after_first = true }, javascript = { "dprint", "prettier", stop_after_first = true },
markdown = { "dprint", "prettier", stop_after_first = true }, markdown = { "dprint", "prettier", stop_after_first = true },
javascriptreact = { "dprint", "prettier", stop_after_first = true }, javascriptreact = { "dprint", "prettier", stop_after_first = true },
@@ -31,12 +31,13 @@ conform.setup({
svelte = { "dprint", "prettier", stop_after_first = true }, svelte = { "dprint", "prettier", stop_after_first = true },
html = { "dprint", "prettier", stop_after_first = true }, html = { "dprint", "prettier", stop_after_first = true },
}, },
format_on_save = {
lsp_fallback = true,
},
}) })
vim.keymap.set({ 'n', 'v' }, '<leader>bf', vim.keymap.set({ 'n', 'v' }, '<leader>bf',
function() function()
conform.format { async = true, lsp_format = 'fallback' } conform.format { async = true }
end, end,
{ desc = 'Format buffer' }) { desc = 'Format buffer' })