about summary refs log tree commit diff
path: root/init/haskell-setup.el
blob: bd61013c25b8107f8361cd66b1a055b585c02480 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
(require 'haskell-mode)

;; Setup for Haskell mode

(add-hook 'haskell-mode-hook 'interactive-haskell-mode)
(add-hook 'haskell-mode-hook 'hi2-mode)

;; Bindings

(defun haskell-mode-binding-setup ()
  (interactive)
  (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
  (define-key haskell-mode-map (kbd "C-c C-c") 'haskell-compile)
  (define-key haskell-mode-map (kbd "C-r") 'haskell-interactive-bring)
  (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space))

(eval-after-load "haskell-mode"
  '(haskell-mode-binding-setup))

(eval-after-load "haskell-cabal"
  '(define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-compile))

;; Settings

(setq haskell-interactive-popup-errors nil
      haskell-stylish-on-save t
      haskell-tags-on-save t
      haskell-process-suggest-remove-import-types t
      haskell-process-auto-import-loaded-modules t
      haskell-process-log t
      haskell-process-type 'ghci
      haskell-process-show-debug-tips nil)

(provide 'haskell-setup)