diff --git a/README.md b/README.md index 1afbd5b..985e8f8 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,9 @@ Part of the Dart SDK (make sure it is on your PATH). See https://www.dartlang.or * `perltidy` for __Perl__. It can be installed from CPAN `cpanm Perl::Tidy` . See https://metacpan.org/pod/Perl::Tidy and http://perltidy.sourceforge.net/ for more info. +* `stylish-haskell` for __Haskell__ +It can be installed using [`cabal`](https://www.haskell.org/cabal/) build tool. Installation instructions are available at https://github.com/jaspervdj/stylish-haskell#installation + How can I change the behaviour of formatters, or add one myself? ---------------------------------------------------------------- If you need a formatter that is not among the defaults, or if you are not satisfied with the default formatting behaviour that is provided by vim-autoformat, you can define it yourself. diff --git a/plugin/defaults.vim b/plugin/defaults.vim index b922be4..0414afd 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -225,3 +225,12 @@ endif if !exists('g:formatters_perl') let g:formatters_perl = ['perltidy'] endif + +" Haskell +if !exists('g:formatdef_stylish_haskell') + let g:formatdef_stylish_haskell = '"stylish-haskell"' +endif + +if !exists('g:formatters_haskell') + let g:formatters_haskell = ['stylish_haskell'] +endif