diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 6357da0..cdb8ae4 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -35,11 +35,20 @@ return { end, formatters_by_ft = { lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + yaml = { 'yamlfmt' }, + c = { 'clang-format' }, + }, + formatters = { + ['yamlfmt'] = { + prepend_args = { '-formatter', 'retain_line_breaks_single=true,trim_trailing_whitespace=true' }, + }, + -- all of the builtin clang-format styles are pretty bad IMHO. don't fallback to any. + -- unfortunately, `--fallback-style` doesn't allow inline customization like the + -- `--style` option does. + -- i really can't say that i'm impressed with clang-format overall ... + ['clang-format'] = { + prepend_args = { '--style=file', '--fallback-style=none' }, + }, }, }, },