Use fourmolu as Haskell formatter and fixer

This commit is contained in:
Yannick Reiß 2024-10-08 10:07:17 +02:00
parent 8cb88ec054
commit 02c752a943
2 changed files with 15 additions and 0 deletions

View File

@ -43,6 +43,20 @@ require("formatter").setup({
require("formatter.filetypes.rust").rustfmt, require("formatter.filetypes.rust").rustfmt,
}, },
haskell = {
function()
-- Full specification of configurations is down below and in Vim help
-- files
return {
exe = "fourmolu",
args = {
util.escape_path(util.get_current_buffer_file_path()),
},
stdin = true,
}
end,
},
-- Use the special "*" filetype for defining formatter configurations on -- Use the special "*" filetype for defining formatter configurations on
-- any filetype -- any filetype
["*"] = { ["*"] = {

View File

@ -24,6 +24,7 @@ vim.g.ale_fixers = {
markdown = { "prettier", "pandoc" }, markdown = { "prettier", "pandoc" },
python = { "yapf" }, python = { "yapf" },
pascal = { "ptop" }, pascal = { "ptop" },
haskell = { "fourmolu" },
} }
vim.keymap.set("n", "<leader>lf", ":ALEFix<CR>") vim.keymap.set("n", "<leader>lf", ":ALEFix<CR>")