2024-09-19 12:58:41 -03:00
|
|
|
return {
|
|
|
|
|
{
|
|
|
|
|
"stevearc/conform.nvim",
|
|
|
|
|
lazy = true,
|
|
|
|
|
event = { "BufWritePre" },
|
|
|
|
|
cmd = { "ConformInfo" },
|
|
|
|
|
keys = {
|
|
|
|
|
{
|
|
|
|
|
"<F3>",
|
|
|
|
|
function()
|
|
|
|
|
require("conform").format({ async = true })
|
|
|
|
|
end,
|
|
|
|
|
mode = "",
|
|
|
|
|
desc = "Format buffer",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
opts = {
|
|
|
|
|
formatters_by_ft = {
|
2024-10-27 23:51:21 -03:00
|
|
|
kdl = { "kdlfmt" },
|
|
|
|
|
terraform = { "terraform_fmt" },
|
2024-09-19 12:58:41 -03:00
|
|
|
},
|
|
|
|
|
default_format_opts = {
|
|
|
|
|
lsp_format = "fallback",
|
|
|
|
|
},
|
|
|
|
|
format_on_save = { timeout_ms = 500 },
|
|
|
|
|
-- Customize formatters
|
|
|
|
|
formatters = {
|
|
|
|
|
shfmt = {
|
|
|
|
|
prepend_args = { "-i", "2" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
init = function()
|
|
|
|
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
}
|