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:
@@ -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' }
|
||||
end,
|
||||
{ desc = 'Format buffer' })
|
||||
|
||||
|
||||
function()
|
||||
conform.format { async = true }
|
||||
end,
|
||||
{ desc = 'Format buffer' })
|
||||
|
||||
Reference in New Issue
Block a user