Skip to content

Commit

Permalink
Add hfmt (#33)
Browse files Browse the repository at this point in the history
rm `stylish-haskell` STDERR redirect to /dev/null

Latest version of `stylish-haskell` supports correct error codes.

Add `hfmt` formatter for Haskell

Update docs
  • Loading branch information
alok authored and sbdchd committed Jan 12, 2017
1 parent eed4b2f commit 4d1f13d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -194,6 +194,8 @@ endfunction
[`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports)
- Haskell
- [`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell)
- [`hindent`](https://github.com/chrisdone/hindent)
- [`hfmt`](https://github.com/danstiner/hfmt)
- HTML
- `html-beautify` (ships with [`js-beautify`](https://github.com/beautify-web/js-beautify)),
[`prettydiff`](https://github.com/prettydiff/prettydiff)
Expand Down
11 changes: 9 additions & 2 deletions autoload/neoformat/formatters/haskell.vim
@@ -1,5 +1,5 @@
function! neoformat#formatters#haskell#enabled() abort
return ['hindent', 'stylishhaskell']
return ['hindent', 'stylishhaskell', 'hfmt']
endfunction

function! neoformat#formatters#haskell#hindent() abort
Expand All @@ -13,7 +13,14 @@ endfunction
function! neoformat#formatters#haskell#stylishhaskell() abort
return {
\ 'exe': 'stylish-haskell',
\ 'args': ['2>/dev/null'],
\ 'stdin': 1,
\ }
endfunction

function! neoformat#formatters#haskell#hfmt() abort
return {
\ 'exe': 'hfmt',
\ 'args': ['-'],
\ 'stdin': 1,
\ }
endfunction
2 changes: 2 additions & 0 deletions doc/neoformat.txt
Expand Up @@ -191,6 +191,8 @@ SUPPORTED FILETYPES *neoformat-supported-filetypes*
[`goimports`](https://godoc.org/golang.org/x/tools/cmd/goimports)
- Haskell
- [`stylish-haskell`](https://github.com/jaspervdj/stylish-haskell)
- [`hindent`](https://github.com/chrisdone/hindent)
- [`hfmt`](https://github.com/danstiner/hfmt)
- HTML
- `html-beautify` (ships with [`js-beautify`](https://github.com/beautify-web/js-beautify)),
[`prettydiff`](https://github.com/prettydiff/prettydiff)
Expand Down

0 comments on commit 4d1f13d

Please sign in to comment.