Using vim-plug:
Plug 'vmchale/pointfree'
Note that the pointfree
binary must be on your path. You can install it with:
$ cabal install pointfree
To use this plugin, either type :PointfreeLine
to run on the current line, or
:Pointfree
along with an expression, e.g.
:Pointfree \x -> x * 2
This plugin provides one keybinding, but you have to pick the keys yourself.
This is what I use in my .vimrc
:
au BufNewFile,BufRead *.hs nmap pf <Plug>Pointfree
If you get stuck at any time, you can view the documentation with:
:help pointfree