nvim: Update conform config
This commit is contained in:
parent
b355434763
commit
3dffd94315
@ -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,
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user