nvim: Update conform config

This commit is contained in:
2025-11-30 16:19:26 +01:00
parent b355434763
commit 3dffd94315

View File

@@ -1,10 +1,20 @@
return {
"stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" },
config = function()
config = function(_, opts)
local conform = require("conform")
conform.setup({
conform.setup(opts)
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 1000,
})
end, { desc = "Format file or range (in visual mode)" })
end,
opts = {
formatters_by_ft = {
css = { "prettier" },
go = { "gofumpt" },
@@ -22,14 +32,5 @@ return {
typescript = { "prettier" },
yaml = { "prettier" },
},
})
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 1000,
})
end, { desc = "Format file or range (in visual mode)" })
end,
},
}