How to install Ormolu in Vim and format when saving?
Install Ormolu:
ghcup install cabal latest
cabal install ormolu
Ensure the created binary is in your $PATH
.
Install Vim plugin:
git -C ~/.vim/pack/plugins/start clone https://github.com/sdiehl/vim-ormolu
Add autocmd to ~/.vimrc
:
autocmd BufWritePre *.hs :call RunOrmolu()