summaryrefslogtreecommitdiff
path: root/after/plugin/conform.lua
blob: d233d3af245ac63f785c1438bd6996584ccd8223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require("conform").setup({
	formatters_by_ft = {
		lua = { "stylua" },
		-- html = { "prettier" },
		go = { "goimports", "gofmt" },
		c = { "clang-format" },
	},
	format_on_save = {
		-- These options will be passed to conform.format()
		timeout_ms = 500,
		lsp_format = "fallback",
	},
})

require("conform").formatters["clang-format"] = {
	prepend_args = {
		"--style",
		"{IndentWidth: 4, AlignAfterOpenBracket: BlockIndent, AlignConsecutiveAssignments: Consecutive, AlignArrayOfStructures: Right, BreakBeforeBraces: Linux}",
	},
}