sdiehl / vim-ormolu

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

Enable ormolu saving on all haskell files #2

Closed lrworth closed 4 years ago

lrworth commented 4 years ago

Some Haskell files start with a shebang:

#!/usr/bin/env stack

and vim can detect this line and set filetype=haskell even when the file doesn't have a .hs extension.

For example:

au BufRead,BufNewFile * if search('^#!/usr/bin/env stack$', 'nw') | setlocal filetype=haskell | endif
sdiehl commented 4 years ago

This overrides the detection of the .hs extension though? I'm cool with including this but it should support both cases.