A minimal emacs configuration for haskell programming using dante and friends.
- Coming from Vim? Try the evil branch which includes vim key bindings
Package management approach is based on this tutorial.
To get a haskell compiler, I recommend downloading Stack and running
stack setup to install GHC.
To install this configuration, clone the repository and place the following files at your home directory:
.emacs- emacs will call this file first which will trigger the whole thing. Also contains a few convenient tweaks.
.emacs.d/my-packages.el- contains the list of packages to install when starting emacs
.emacs.d/my-loadpackages.el- defines how to enable and setup the packages we use
WARNING: Backup your changes to all your emacs related files before running the following commands as they will override your files!
So the steps are:
git clone https://github.com/soupi/minimal-haskell-emacs cp minimal-haskell-emacs/.emacs ~/ cp -r minimal-haskell-emacs/.emacs.d ~/
Now just run Emacs and start hacking!
Note: dante has recently changed to stop working with temporary files. There are two ways this can work:
Flycheck will save the file all the time without you explicitly saving and you will get flycheck comments on the fly or:
You can tell flycheck not the save the file and only see errors when you manually save. To do that uncomment the following lines in
(setq flymake-no-changes-timeout nil) (setq flymake-start-syntax-check-on-newline nil) (setq flycheck-check-syntax-automatically '(save mode-enabled))
Another approach is to use temp files. You can do that with [this fork][https://github.com/soupi/dante/tree/with-temp-files].
To use temp files, you'll need a couple of extra steps:
Install minimal-haskell-emacs the normal way including running emacs and letting it install all of the packages
Do the following steps:
git clone -b with-temp-files https://github.com/soupi/dante dante-with-temp-files rm ~/.emacs.d/elpa/dante*/dante.elc cp dante-with-temp-files/dante.el ~/.emacs.d/elpa/dante*/dante.el
After that when you run emacs you should be able to use dante and get flycheck comments while the buffer is changed but not saved.