Skip to content
A vim plugin that helps you refactor Haskell code
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
plugin
.vader
README.md
demo.gif
vader-tests.png

README.md

Haskell Refactor

A lightweight vim plugin that helps you refactor Haskell code.

Demo

Installation

With Plug add,

Plug 'chris-bacon/haskell-refactor'

to your vimrc.

Alternatively, you can clone this repo.

Usage

Commands

Select the code you wish to refactor in visual mode. You can then use the following commands:

:ExtractHaskellFunction <name> <params>
:ExtractHaskellType <name>

All options are optional. Every command will default to a prompt if no args are provided, so you do not need to provide any arguments. This also means you can use the following mappings.

Mappings

You following are examples of mappings you could create for each command:

vnoremap <leader>ef :ExtractHaskellFunction<cr>
vnoremap <leader>et :ExtractHaskellType<cr>

Contributing

Please feel free to raise any issues or PRs.

Tests

There are some tests to ensure regressions are not added.

You will need to have vader installed. Then you will be able to run :Vader .vader and hopefully see the following output:

Tests Image

Unfortunately, the tests are sensitive to whitespace so you will have to be vigilent with regards to whitespace.

You can’t perform that action at this time.