nvim: Update conform config

This commit is contained in:
Václav Uruba 2025-11-30 16:19:26 +01:00
parent b355434763
commit 3dffd94315
Signed by: uruba
GPG Key ID: 9D8E987C4B2E1E9C

View File

@ -1,10 +1,20 @@
return { return {
"stevearc/conform.nvim", "stevearc/conform.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
config = function() config = function(_, opts)
local conform = require("conform") 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 = { formatters_by_ft = {
css = { "prettier" }, css = { "prettier" },
go = { "gofumpt" }, go = { "gofumpt" },
@ -22,14 +32,5 @@ return {
typescript = { "prettier" }, typescript = { "prettier" },
yaml = { "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,
} }