Skip to content

chrisgrounds/haskell-refactor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A vim plugin that helps you refactor Haskell code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages