Add support for cabal-fmt to haskell mode

This commit is contained in:
Sameer Rahmani 2024-06-09 21:19:39 +01:00
parent 78efcb37f0
commit e10ea654ac
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
2 changed files with 13 additions and 2 deletions

View File

@ -48,6 +48,7 @@ in
fg42.paths = (with pkgs;[
haskell-language-server
haskellPackages.cabal-fmt
ghc
]);

View File

@ -78,7 +78,8 @@
(haskell-mode . turn-on-haskell-doc-mode)
(haskell-mode . haskell-indentation-mode)
(haskell-mode . haskell-setup-outline-mode)
(haskell-mode . (lambda ()
(require 'haskell-commands)))
:bind
(:map haskell-mode-map
("M-n" . haskell-goto-next-error)
@ -86,9 +87,18 @@
("C-c c" . haskell-compile)))
(cl-defmethod fg42/format-buffer-for ((mode (eql haskell-cabal-mode)))
"Use `cabal-fmt' to format the buffer whenever `haskell-cabal-mode' MODE is active."
(message "hehehehehehe")
(haskell-mode-buffer-apply-command "cabal-fmt"))
(use! haskell-cabal-mode
"Cabal integration."
:mode ("\\.cabal\\'"))
:mode ("\\.cabal\\'")
:hook (haskell-cabal-mode . (lambda ()
(require 'haskell-commands))))
(provide 'fg42/haskell-support)