When I turn on autoindent
for a regular *.hs file, the after pressing Enter the new line is indented as expected. However, this doesn't work with literate Haskell *.lhs files whose code lines start with >
(AKA "bird-tracks"). The cursor is always positioned at the first column.
How can I set up vim so that when I'm inside a piece of code in a *.lhs file (and let\s say have autoindent
on), pressing Enter creates a bird track at the new line and indents appropriately?
Update: To give an example, let's say have
> myfn x | x <= 0 = 0
> | x == 1 = 1▌
where ▌
represents the position of the cursor (I hope you have no problem seeing the unicode character.) If I press Enter, I end up with
> myfn x | x <= 0 = 0
> | x == 1 = 1
▌
whereas I want
> myfn x | x <= 0 = 0
> | x == 1 = 1
> ▌