sdiehl / vim-ormolu

Plugin for formatting Haskell source code
MIT License
39 stars 3 forks source link

Run ormolu over the (possibly unsaved) contents of the buffer #9

Closed mitchellwrosen closed 4 years ago

mitchellwrosen commented 4 years ago

Currently, vim-ormolu requires you to save a file before formatting it. Would it be possible to run ormolu over the contents of the buffer instead?

sdiehl commented 4 years ago

This was trivial to add. I patched it in beb1423.

In your buffer run:

set filetype=haskell

Then you can invoke whatever commands you like :call RunOrmolu() or :call OrmoluBlock() on the contents of the unsaved buffer.

mitchellwrosen commented 4 years ago

Thanks!! :)