nvim: Update conform config
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user