glittershark / vim-hare

Vim bindings to the HaRe haskell refactoring tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 entire if/then/else expression is highlighted in visual mode, converts that expression to a case statement

Installation

First, install HaRe itself

cabal install hare

Make sure to do this outside any sandboxes for now, as hare.vim assumes ghc-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

About

Vim bindings to the HaRe haskell refactoring tool

License:Other


Languages

Language:Vim Script 100.0%