This requires emacs24
or newer.
First, install MELPA
:
sudo emacs /etc/emacs/site-start.el
Paste in this code: (from https://melpa.org/#/getting-started)
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
Save and exit.
Second, install haskell-mode
To get haskell pretty-printing and indentation, do this to install haskell-mode:
emacs
M-x package-list-packages RET (Type meta-key and S, then type package-list-packages and hit return)
C-s haskell-mode RET (Type control-S to search, type nginx and hit return to find the haskell-mode package)
i (to mark it to install)
x (to execute installation of marked packages)
Use haskell-mode
Haskell mode will load automatically for haskell files. IF you want to load it manually, you can switch into haskell-mode with M-x haskell-mode
.