Created
January 17, 2017 09:50
-
-
Save wsgac/d74365e8410918adc788526ad911a784 to your computer and use it in GitHub Desktop.
A work-in-progress Emacs configuration for Haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;;;;;;;;;;;;;;;;;; | |
;; ;;;;;;;;;;;;; ;; | |
;; ;; Haskell ;; ;; | |
;; ;;;;;;;;;;;;; ;; | |
;;;;;;;;;;;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;; | |
;; Prerequisites ;; | |
;;;;;;;;;;;;;;;;;;; | |
;; (package-install 'haskell-mode) | |
;; (package-install 'hindent) | |
;; (package-install 'ghc) | |
;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Unix Configuration ;; | |
;;;;;;;;;;;;;;;;;;;;;;;; | |
;; stack install happy | |
;; stack install hindent | |
;; stack install hasktags | |
;; stack install stylish-haskell | |
;; stack install ghc-mod | |
;; stack install hlint | |
;; stack install hoogle | |
;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Emacs Configuration ;; | |
;;;;;;;;;;;;;;;;;;;;;;;;; | |
(add-hook 'haskell-mode-hook 'hindent-mode) | |
;; (add-hook 'inferior-haskell-mode-hook 'turn-on-ghci-completion) | |
(eval-after-load 'haskell-mode | |
'(define-key haskell-mode-map [f8] 'haskell-navigate-imports)) | |
(let ((my-stack-path (expand-file-name "~/.local/bin"))) | |
(setenv "PATH" (concat my-stack-path path-separator (getenv "PATH"))) | |
(add-to-list 'exec-path my-stack-path)) | |
(setq haskell-program-name "stack repl") | |
(setq haskell-compile-cabal-build-command "stack build") | |
;; (setq haskell-ghci-program-name "stack repl") | |
;; (add-hook 'haskell-mode-hook 'turn-on-haskell-unicode-input-method) | |
(require 'haskell-interactive-mode) | |
(require 'haskell-process) | |
(add-hook 'haskell-mode-hook 'interactive-haskell-mode) | |
(custom-set-variables | |
'(haskell-stylish-on-save t) | |
'(haskell-tags-on-save t) | |
'(haskell-process-suggest-remove-import-lines t) | |
'(haskell-process-auto-import-loaded-modules t) | |
'(haskell-process-log t) | |
'(haskell-process-type 'stack-ghci) | |
) | |
(define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload) | |
(define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring) | |
(define-key haskell-mode-map (kbd "C-c C-t") 'haskell-process-do-type) | |
(define-key haskell-mode-map (kbd "C-c C-i") 'haskell-process-do-info) | |
(define-key haskell-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build) | |
(define-key haskell-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear) | |
(define-key haskell-mode-map (kbd "C-c c") 'haskell-process-cabal) | |
(define-key haskell-mode-map (kbd "M-.") 'haskell-mode-jump-to-def) | |
(define-key haskell-cabal-mode-map (kbd "C-`") 'haskell-interactive-bring) | |
(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) | |
;; (eval-after-load 'haskell-mode | |
;; '(define-key haskell-mode-map (kbd "C-c C-c") 'haskell-compile)) | |
;; (eval-after-load 'haskell-cabal | |
;; '(define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-compile)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since posting this I've become a user of
use-package
, which makes configuring modules easier and more elegant. I'll soon modify this snippet accordingly.