1local formatter = require("formatter")
2
3formatter.setup({
4 filetype = {
5 nix = { require("formatter.filetypes.nix").alejandra },
6 lua = { require("formatter.filetypes.lua").stylua },
7 fish = { require("formatter.filetypes.fish").fishindent },
8 },
9 ["*"] = {
10 require("formatter.filetypes.any").remove_trailing_whitespace,
11 },
12})
13
14vim.api.nvim_create_augroup("__formatter__", { clear = true })
15vim.api.nvim_create_autocmd("BufWritePost", {
16 group = "__formatter__",
17 command = ":FormatWrite",
18})