nvim-config/lua/configs/conform.lua

28 lines
606 B
Lua

local options = {
formatters_by_ft = {
bash = { "shfmt" },
css = { "prettier" },
json = { "prettier" },
html = { "prettier" },
lua = { "stylua" },
markdown = { "prettier" },
sh = { "shfmt" },
yaml = { "yamlfmt" },
},
formatters = {
yamlfmt = {
prepend_args = {
"-formatter",
"include_document_start=true,retain_line_breaks=true,retain_line_breaks_single=true,max_line_length=120,scan_folded_as_literal=true",
},
},
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
}
require("conform").setup(options)