nvim-config/lua/configs/conform.lua

29 lines
626 B
Lua
Raw Normal View History

2024-04-08 09:26:41 +00:00
local options = {
formatters_by_ft = {
2024-04-15 09:32:16 +00:00
bash = { "shfmt" },
css = { "prettier" },
json = { "prettier" },
html = { "prettier" },
lua = { "stylua" },
2024-04-23 14:18:38 +00:00
markdown = { "prettier" },
sh = { "shfmt" },
yaml = { "yamlfmt" },
},
formatters = {
yamlfmt = {
prepend_args = {
"-formatter",
2024-05-10 19:16:30 +00:00
"include_document_start=true,retain_line_breaks=true,retain_line_breaks_single=true,max_line_length=120,scan_folded_as_literal=true,pad_line_comments=2",
},
},
2024-04-08 09:26:41 +00:00
},
2024-04-15 09:32:16 +00:00
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
2024-04-08 09:26:41 +00:00
}
require("conform").setup(options)