Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _____________
- EMACS-SETUP
- Lemao
- _____________
- Table of Contents
- _________________
- 1 Emacs installation
- 2 MELPA package repository
- 3 Flycheck installation
- 4 Auto-complete installation
- 5 Haskell support installation
- 1 Emacs installation
- ====================
- 1. Install [Emacs 24 Starter-kit]
- ,----
- | git clone http://github.com/eschulte/emacs24-starter-kit.git .emacs.d
- `----
- 1. Run 'emacs' to complete the installation
- [Emacs 24 Starter-kit] http://eschulte.github.io/emacs24-starter-kit/
- 2 MELPA package repository
- ==========================
- 1. Edit ~/.emacs.d/${USER}.el
- ,----
- | ;; [==:INIT package manager==]
- | (require 'package)
- | (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
- | (package-initialize)
- `----
- 1. Restart emacs and refresh package contents
- ,----
- | M-x package-refresh-contents RET
- `----
- NOTE: you should see refreshing package contents from
- melpa.milkbox.net
- 3 Flycheck installation
- =======================
- 1. Install flycheck
- ,----
- | M-x package-install RET flycheck RET
- `----
- 1. Install flycheck color mode line
- ,----
- | M-x package-install RET flycheck-color-mode-line RET
- `----
- 1. Configure flycheck
- Add the following to your ~/.emacs.d/${USER}.el:
- ,----
- | ;; [==:INIT flycheck==]
- | (add-hook 'after-init-hook 'global-flycheck-mode)
- | ;; (setq flycheck-check-syntax-automatically '(mode-enabled idle-change))
- |
- | ;; (require 'flycheck-color-mode-line))
- | ;; (eval-after-load "flycheck"
- | ;; '(add-hook 'flycheck-mode-hook 'flycheck-color-mode-line-mode))
- `----
- 4 Auto-complete installation
- ============================
- 1. Install the auto-complete package
- ,----
- | M-x package-install RET auto-complete RET
- `----
- 1. Configure auto-complete
- ,----
- | ;; [==:INIT flycheck==]
- | (require 'auto-complete)
- `----
- 5 Haskell support installation
- ==============================
- 1. Install Haskell Platform
- 2. Update cabal repository
- ,----
- | cabal update
- `----
- 1. Install cabal packages
- ,----
- | cabal install hdevtools ghc-mod hlint stylish-haskell
- `----
- 1. Install Haskell Emacs front-end(s)
- ,----
- | M-x package-install RET haskell-mode
- | M-x package-install RET ghc
- | M-x package-install RET ghci-completion
- `----
- 1. Configure haskell-mode, ghc
- ,----
- | ;; [==:INIT haskell-mode==]
- | (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
- |
- | ;; [==:INIT ghc-mod==]
- | (autoload 'ghc-init "ghc" nil t)
- | (add-hook 'haskell-mode-hook
- | (lambda ()
- | (ghc-init)))
- |
- | ;; [==:INIT auto-complete==]
- | (ac-define-source ghc-mod
- | '((depends ghc)
- | (candidates . (ghc-select-completion-symbol))
- | (symbol . "s")
- | (cache)))
- |
- | (defun my-ac-haskell-mode ()
- | (setq ac-sources '(ac-source-words-in-same-mode-buffers
- | ac-source-dictionary
- | ac-source-ghc-mod)))
- | (add-hook 'haskell-mode-hook 'my-ac-haskell-mode)
- |
- |
- | ;; [==:INIT fnd-file-hook==]
- | (defun my-haskell-ac-init ()
- | (when (member (file-name-extension buffer-file-name) '("hs" "lhs"))
- | (auto-complete-mode t)
- | (setq ac-sources '(ac-source-words-in-same-mode-buffers
- | ac-source-dictionary
- | ac-source-ghc-mod))))
- | (add-hook 'find-file-hook 'my-haskell-ac-init)
- `----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement