Ⅰ. 插件描述
Vim bindings to the HaRe haskell refactoring toolⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'glittershark/vim-hare'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'glittershark/vim-hare'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'glittershark/vim-hare'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/glittershark/vim-hare
Ⅳ. 文档说明
# HaRe.vim
Vim bindings to the HaRe Haskell refactoring tool
Usage
This plugin is solidly WIP / holiday project status at the moment, and so there
could be bugs lurking around any corner.
All commands listed below will provide a preview window with a diff of all files
affected by the pending refactor. Pressing Enter in this window will
apply the refactor to all affected files, but not save them. Pressing
q will abort.
Commands:
:Hrename newSymbolName- Rename symbol under the cursor to newSymbolName:Hlifttotop- Lift local function definition under the cursor to the
top level:Hiftocase- if an entireif/then/elseexpression is highlighted in
visual mode, converts that expression to acasestatement
Installation
First, install HaRe itself
cabal install hareMake sure to do this outside any sandboxes for now, as hare.vim assumesghc-hare exists somewhere on your PATH. If you want to override this, you can
set g:hare_executable to something like cabal exec -- ghc-hare, though
obviously this won't work on a per-project basis.
Another caveat, mentioned in the hare docs, is that HaRe doesn't
like GHC versions before 7.10.2. Make sure you're running 7.10.2 or greater at
a system level and also at a per-project level.
Then install the vim plugin
I like [Vundle][] a lot. To install using Vundle, add the following to the
plugin section of your vimrc or other:
Plugin 'glittershark/vim-hare'Then run :PluginInstall from within vim
To install using [Pathogen][]:
cd ~/.vim/bundle
git clone git://github.com/glittershark/vim-hare.git