...The 'formatprg' option lets you use an external program (like hindent) to format your text. Note that unlike in emacs you have to take care of selecting a sensible buffer region as input to hindent yourself. If that is too much trouble you can try vim-textobj-haskell which provides a text object for top-level bindings.