Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 2.68 KB

starter-kit-haskell.org

File metadata and controls

78 lines (65 loc) · 2.68 KB

:#+TITLE: Starter Kit Haskell

This is part of the Emacs Starter Kit.

Starter Kit Haskell

Support for editing Haskell

Install Haskell packages

(setq install-packages (list 'haskell-mode
                             'ghc
                             'company-ghc
                             'shm
                             'hi2
                             'intero
                             'hindent))
(dolist (package install-packages) (package-install package))

Cabal sandbox path

(let ((my-cabal-path (expand-file-name "~/.emacs.d/.haskell-environments/.cabal-sandbox/bin")))
  (setenv "PATH" (concat my-cabal-path path-separator (getenv "PATH")))
  (add-to-list 'exec-path my-cabal-path))
(custom-set-variables '(haskell-tags-on-save t))

Haskell mode hook

(add-hook 'haskell-mode-hook
          (lambda ()
           'run-coding-hook
           'turn-on-haskell-indentation
           'turn-on-hi2
           'hindent-mode
           'intero-mode
           ;;(haskell-indent-spaces . 4)
           ((hindent-style . "johan-tibell"))))

;;(add-to-list 'company-backends 'company-ghc)

Funcktion keybinding

(custom-set-variables
  '(haskell-process-suggest-remove-import-lines t)
  '(haskell-process-auto-import-loaded-modules t)
  '(haskell-process-log t))
(eval-after-load 'haskell-mode '(progn
  (define-key haskell-mode-map (kbd "s-i") 'haskell-navigate-imports)
  (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
  (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
  (define-key haskell-mode-map (kbd "C-c C-n C-t") 'haskell-process-do-type)
  (define-key haskell-mode-map (kbd "C-c C-n C-i") 'haskell-process-do-info)
  (define-key haskell-mode-map (kbd "C-c C-n C-c") 'haskell-process-cabal-build)
  (define-key haskell-mode-map (kbd "C-c C-n c") 'haskell-process-cabal)))
  ;;(define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)))
(eval-after-load 'haskell-cabal '(progn
  (define-key haskell-cabal-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
  (define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
  (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
  (define-key haskell-cabal-mode-map (kbd "C-c c")
  'haskell-process-cabal)))
(message "------ Starter Kit Haskell loaded ------")