Configure hi2

Resolves #356
This commit is contained in:
Chris Barrett 2014-12-31 12:21:48 +13:00 committed by syl20bnr
parent 2860a8e763
commit d54e1ae4c7
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,7 @@
(defun spacemacs/haskell-show-hi2-guides ()
(when (and (boundp 'hi2-mode) hi2-mode)
(hi2-enable-show-indentations)))
(defun spacemacs/haskell-hide-hi2-guides ()
(when (and (boundp 'hi2-mode) hi2-mode)
(hi2-disable-show-indentations)))

View file

@ -4,6 +4,7 @@
flycheck-haskell
ghc
haskell-mode
hi2
))
;; Only load company-ghc if company-mode is enabled
@ -153,3 +154,16 @@
(add-to-list 'company-backends 'company-ghc)
(ghc-comp-init)
))
(defun haskell/init-hi2 ()
(use-package hi2
:diminish hi2-mode
:commands turn-on-hi2
:init
(add-hook 'haskell-mode-hook 'turn-on-hi2)
:config
(progn
;; Show indentation guides for hi2 only in insert state.
(add-hook 'evil-normal-state-entry-hook 'spacemacs/haskell-hide-hi2-guides)
(add-hook 'evil-insert-state-entry-hook 'spacemacs/haskell-show-hi2-guides)
(add-hook 'evil-insert-state-exit-hook 'spacemacs/haskell-hide-hi2-guides))))