From cdde7294ffe91bf864c5c2a6049e4d6f9d3c6fea Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sat, 30 Nov 2024 18:18:28 +0530 Subject: [PATCH] nvim: after/ftplugin/haskell: Lint on save Now that we use static-ls as Haskell LSP which does not have hlint support for diagnostics yet, lint on save to get hlint diagnostics. --- nvim/.config/nvim/after/ftplugin/haskell.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nvim/.config/nvim/after/ftplugin/haskell.lua b/nvim/.config/nvim/after/ftplugin/haskell.lua index 9362461..75487e9 100644 --- a/nvim/.config/nvim/after/ftplugin/haskell.lua +++ b/nvim/.config/nvim/after/ftplugin/haskell.lua @@ -4,3 +4,10 @@ local hls_config = lsp_utils.hls_config() vim.lsp.start(hls_config) vim.bo.makeprg = 'cabal build --write-ghc-environment-files=always all' + +vim.api.nvim_create_autocmd({ "BufWritePost" }, { + buffer = 0, + callback = function() + require("lint").try_lint() + end, +})