begriffs / haskell-vim-now

One-line Haskell Vim install
MIT License
988 stars 100 forks source link

:Align = aligns weiiiird? #292

Closed peterstorm closed 6 years ago

peterstorm commented 6 years ago

I have this code:

mult1 = x * y
where x = 5
y = 6

and :Align = refactors that to

mult1     = x * y
where x = 5
y            = 6

which is not valid haskell :( Is there any better alternative?

peterstorm commented 6 years ago

Ok, the last example is actually aligned on the equal signs, but shouldn't it push the y out to the equal sign?

begriffs commented 6 years ago

I think Align doesn't know about Haskell, it just manipulates plain text.

For Haskell code formatting, try selection a region and pressing gq, which spawns hindent. Not sure if it will align equal signs though.

peterstorm commented 6 years ago

Oh, damn :(

Isn't there some way I could write code to lint, so everything aligned on equal signs, but still stayed with connected to the signs, and didn't get unnested?