Ⅰ. 插件描述
A vim plugin that helps you refactor Haskell codeⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'chris-bacon/haskell-refactor'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'chris-bacon/haskell-refactor'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'chris-bacon/haskell-refactor'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/chris-bacon/haskell-refactor
Ⅳ. 文档说明
# Haskell Refactor
A lightweight vim plugin that helps you refactor Haskell code.

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:

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