summaryrefslogtreecommitdiffstats
path: root/nvim/lua/plugins/conform/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua/plugins/conform/init.lua')
-rw-r--r--nvim/lua/plugins/conform/init.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/nvim/lua/plugins/conform/init.lua b/nvim/lua/plugins/conform/init.lua
new file mode 100644
index 0000000..374ed55
--- /dev/null
+++ b/nvim/lua/plugins/conform/init.lua
@@ -0,0 +1,17 @@
+require("conform").setup({
+ formatters_by_ft = {
+ haskell = { "ormolu" },
+ },
+ formatters = {
+ ormolu = {
+ command = "ormolu",
+ args = { "--stdin-input-file", "$FILENAME" },
+ stdin = true,
+ },
+ },
+ format_on_save = { timeout_ms = 2000, lsp_format = "never" },
+})
+
+vim.keymap.set({ "n", "v" }, "<leader>f", function()
+ require("conform").format({ async = true, lsp_format = "never" })
+end)