Vim indent plugin for Haskell

I’ve made avim plugin to make Haskell code easier to indent.
I know there are lots of formatter around but for to work code still need to be formatted somehow and I prefer to get right from the start (so I don’t need a formatter).

The way this plugin is really simple, wheither you use tab in insert mode or try to shift blocks, instead of shifting by a set amount of space it align the code with the beginning of the words above. If you prefer it uses tab stops set at the beginning of each words of the previous line(s).
You can see it working on the image below, the 3 last line are just being moved using < and >.

It works without having to configure anything and work with any coding style (you are responsible of the line break, it just do the alignment).

shift example

3 Likes