From 75db9f48d699d866e19f408d057f486175127e4a Mon Sep 17 00:00:00 2001 From: Théophane Hufschmitt Date: Fri, 29 Jun 2018 17:00:13 +0200 Subject: README: Mention vim-autoformat A more generic and better-behaving plugin than `vim-stylish-haskell`, so worth mentioning as an alternative --- README.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.markdown b/README.markdown index ea23a47..7245f10 100644 --- a/README.markdown +++ b/README.markdown @@ -124,6 +124,16 @@ Or you can define `formatprg` and then use `gq`. +Alternatively, [vim-autoformat] supports stylish-haskell. To have it automatically reformat the files on save, add to your vimrc: + +```vim +autocmd BufWrite *.hs :Autoformat +" Don't automatically indent on save, since vim's autoindent for haskell is buggy +autocmd FileType haskell let b:autoformat_autoindent=0 +``` + +[vim-autoformat]: https://github.com/Chiel92/vim-autoformat + There is also the [vim-stylish-haskell] plugin, which runs stylish-haskell automatically when you save a Haskell file. -- cgit v1.2.3