I’ve wanted to give Spacemacs another try for Haskell development. In particular, I wanted it to work with intero and hindent.

Install Emacs

I like to use Mitsuharu Yamamoto’s emacs-mac, rather than Aquamacs or emacsformacosx.

$ brew tap railwaycat/emacsmacport
$ brew cask install emacs-mac

Install Dependencies

The haskell layer in Spacemacs requires a few dependencies. I installed them with Stack.

$ stack install hlint hasktags hoogle ghc-mod intero
$ stack --resolver nightly-2017-08-12 install apply-refact

Haskell layer

I added the haskell layer plus autocompletion which it seems to require. I also followed the documentation in configuring intero and hindent (though the style “johan-tibell” no longer seems required as hindent no longer supports multiple styles).

After adding a few other layers, my configuration layers in ~/.spacemacs looked like this:

dotspacemacs-configuration-layers
'(
  ansible
  auto-completion
  emacs-lisp
  git
  (haskell :variables
           haskell-completion-backend 'intero
           haskell-enable-hindent-style "johan-tibell")
  helm
  html
  javascript
  markdown
  org
  osx
  (shell :variables
         shell-default-height 30
         shell-default-position 'bottom)
  spell-checking
  syntax-checking
  themes-megapack
  version-control
  yaml
  )

Project sidebar

I missed having a project sidebar (such as seems to be the default in editors like Atom). Eventually, I found that Spacemacs includes NeoTree, which makes a viable project sidebar. Toggle on/off with SPC p t or SPC f t for a file rather than project browser.

See more in the documentation

Tab bar

I also missed having a tab bar (for open files) such as that in Atom. There doesn’t seem to be anything built into Spacemacs for this. I tried the tabbar-layer, but it was pretty ugly.

After some searching, I figured I could rely on “helm-mini”. It lets you open search/select files from the open buffers with SPC b b. Also searching/selecting for files in the same project is possible from projectile with SPC p f.

Fill column indicator

I wanted my little indicator for the 80th column. Here, you need to tweak your ~/.spacemacs file.

(defun dotspacemacs/user-config ()
  (spacemacs/toggle-fill-column-indicator-on)
  )

Theme

It was fun seeing the different themes available for Spacemacs. It’s best to install themes-megapack layer (see my layers configuration above). I don’t mind the default spacemacs-dark theme but here are some of my other favourites:

Check out the gallery.

I finally settled on deeper-blue.