Unfortunately, the one Haskell indent script I found (by motemen) breaks when it comes to Haddock comments:
-- |Docline 1, lorem ipsum<CR>
-- Docline 2
^^^^ - an autoindent here, wtf
Would anyone happen to know about a better alternative?
Even though the consensus among Haskell programmers is that meaningful indentation leads to better-looking code, understanding how to convert from one style to the other can help understand the indentation rules.
No, Haskell indentation is not like Python. Haskell is not about indentation levels, it's all about making things line up with other things.
Okay, so after even more googling, I found this indent script:
https://github.com/kana/vim-filetype-haskell/blob/master/indent/haskell.vim
It seems to work almost perfectly (ignores if
..then
.. else
and let
). But to be honest, the fact that it doesn't break my documentation makes it good enough right now :)
I've no problems with haskellmode-vim
edit: FWIW, I've found this reddit thread recently. vim2hs looks nice to me, also regarding indentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With