Created
July 13, 2013 09:25
-
-
Save adinapoli/5990152 to your computer and use it in GitHub Desktop.
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
(require 'util) | |
(require 'flycheck) | |
(require 'evil-leader) | |
;;; Code: | |
(add-to-list 'exec-path "~/.cabal/bin/") | |
(add-to-list 'exec-path "~/Library/Haskell/current/bin/") | |
(install-and-require #'haskell-mode) | |
(install-and-require #'ghc) | |
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) | |
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) | |
(setq haskell-program-name "~/Library/Haskell/current/bin/ghci") | |
(load-and-use #'hsenv) | |
(autoload 'ghc-init "ghc" nil t) | |
(add-hook 'haskell-mode-hook (lambda () (ghc-init))) | |
(ac-define-source ghc-mod | |
'((depends ghc) | |
(candidates . (ghc-select-completion-symbol)) | |
(symbol . "s") | |
(document . haskell-doc-sym-doc) | |
(cache))) | |
(defun haskell-autocomplete () | |
(setq ac-sources (list 'ac-source-ghc-mod | |
'ac-source-words-in-same-mode-buffers | |
))) | |
(add-hook 'haskell-mode-hook 'haskell-autocomplete) | |
(flycheck-declare-checker haskell-hlint | |
"A Haskell syntax and style checker using hlint. | |
See URL `http://community.haskell.org/~ndm/hlint/'." | |
:command '("hlint" source-inplace) | |
:error-patterns | |
'(("^\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): Warning: \\(?4:.*\\(\n.+\\)+\\)" warning) | |
("^\\(?1:.*\\):\\(?2:[0-9]+\\):\\(?3:[0-9]+\\): Error: \\(?4:.*\\(\n.+\\)+\\)" error)) | |
:modes 'haskell-mode) | |
(push 'haskell-hlint flycheck-checkers) | |
(flycheck-define-checker haskell-hdevtools | |
"A Haskell syntax and type checker using hdevtools. | |
See URL `https://github.com/bitc/hdevtools'." | |
:command ("hdevtools" "check" "-g" "-Wall" source-inplace) | |
:error-patterns | |
((warning line-start (file-name) ":" line ":" column ":" | |
(or " " "\n ") "Warning:" (optional "\n") | |
(one-or-more " ") | |
(message (one-or-more not-newline) | |
(zero-or-more "\n" | |
(one-or-more " ") | |
(one-or-more not-newline))) | |
line-end) | |
(error line-start (file-name) ":" line ":" column ":" | |
(or (message (one-or-more not-newline)) | |
(and "\n" (one-or-more " ") | |
(message (one-or-more not-newline) | |
(zero-or-more "\n" | |
(one-or-more " ") | |
(one-or-more not-newline))))) | |
line-end)) | |
:modes haskell-mode | |
:next-checkers (haskell-hlint)) | |
(push 'haskell-hdevtools flycheck-checkers) | |
;;; CUSTOM KEYMAPS | |
(evil-leader/set-key-for-mode 'haskell-mode | |
"h" 'haskell-hayoo | |
"c b" 'inferior-haskell-load-file) | |
(provide 'haskell-conf) | |
;;; haskell-conf.el ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment