mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 19:40:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
30
.emacs.d/modules/lang/haskell/+intero.el
Normal file
30
.emacs.d/modules/lang/haskell/+intero.el
Normal file
@@ -0,0 +1,30 @@
|
||||
;;; lang/haskell/+intero.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +intero)
|
||||
|
||||
(use-package! intero
|
||||
:commands intero-mode
|
||||
:init
|
||||
(add-hook! 'haskell-mode-local-vars-hook
|
||||
(defun +haskell-init-intero-h ()
|
||||
"Initializes `intero-mode' in haskell-mode, unless stack isn't installed.
|
||||
This is necessary because `intero-mode' doesn't do its own error checks."
|
||||
(when (derived-mode-p 'haskell-mode)
|
||||
(if (executable-find "stack")
|
||||
(intero-mode +1)
|
||||
(message "Couldn't find stack. Refusing to enable intero-mode.")))))
|
||||
:config
|
||||
(setq haskell-compile-cabal-build-command "stack build --fast")
|
||||
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition)
|
||||
(set-company-backend! 'intero-mode 'intero-company)
|
||||
(when (featurep! :tools flycheck)
|
||||
(flycheck-add-next-checker 'intero '(warning . haskell-hlint)))
|
||||
|
||||
(when (featurep 'evil)
|
||||
(add-hook 'intero-mode-hook #'evil-normalize-keymaps))
|
||||
(map! :localleader
|
||||
:map intero-mode-map
|
||||
"t" #'intero-type-at
|
||||
"i" #'intero-info
|
||||
"l" #'intero-repl-load
|
||||
"e" #'intero-repl-eval-region
|
||||
"a" #'intero-apply-suggestions))
|
||||
Reference in New Issue
Block a user