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
+6 -5
View File
@@ -21,8 +21,8 @@ conform.setup({
cpp = { "clang_format" },
lua = { 'stylua' },
go = { "goimports", "gofmt" },
rust = { "dprint", "rustfmt", lsp_format = "fallback" },
python = { "isort", "black", stop_after_first = true },
rust = { "rustfmt", "dprint", lsp_format = "fallback" },
python = { "ruff", "dprint", stop_after_first = true },
javascript = { "dprint", "prettier", stop_after_first = true },
markdown = { "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 },
html = { "dprint", "prettier", stop_after_first = true },
},
format_on_save = {
lsp_fallback = true,
},
})
vim.keymap.set({ 'n', 'v' }, '<leader>bf',
function()
conform.format { async = true, lsp_format = 'fallback' }
conform.format { async = true }
end,
{ desc = 'Format buffer' })