Jakub Lédl
Jakub Lédl

Reputation: 1805

Is there any good Haskell indentation script for Vim?

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?

Upvotes: 16

Views: 5599

Answers (2)

lewurm
lewurm

Reputation: 1113

I've no problems with haskellmode-vim

edit: FWIW, I've found this reddit thread recently. vim2hs looks nice to me, also regarding indentation.

Upvotes: 4

Jakub L&#233;dl
Jakub L&#233;dl

Reputation: 1805

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 :)

Upvotes: 7

Related Questions