ghci.vim


Ⅰ. 插件描述

↔️ tight ghci integration for vim

Ⅱ. 基本信息

创建日期:  2015-07-30
使用用户:  1
Github星:  13
插件作者:  Sandy Maguire

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'isovector/ghci-vim-left-unsaid'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'isovector/ghci-vim-left-unsaid'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'isovector/ghci-vim-left-unsaid'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/isovector/ghci.vim

Ⅳ. 文档说明

This plugin is still highly experimental and alpha software.

ghci.vim

Tight integration between ghci and vim via tmux.

Features

  • No-nonsense ghci integration

    • Send code directly to ghci without worrying whether or not it's in the

      IO monad; ghci.vim handles all of the syntax for you.
  • All the power of the REPL directly in vim!
  • Automatically fill in types for definitions in three keystrokes

Installation

Use your favorite plugin manager.

Using vim-plug:

Plug 'isovector/ghci.vim'

Quickstart Guide

Start a tmux session, and open ghci in it.

ghci.vim exposes the following key combinations (currently over s, because
it's a shitty mode and a really good key):

  • ssM<Enter>

    • send a movement command M to ghci
    • character-wise movements will be printed in ghci, while line-wise will
      be entered as a definition
  • sL

    • reload the current buffer in ghci
  • st

    • get the type of the symbol under the cursor
  • sT

    • fill in the type of the definition under the cursor

      test a = show a
- press `sT` with the cursor anywhere on this line, result:
test :: Show a => a -> [Char]
test a = show a
  • sr

    • sync the current definition to ghci and run a command afterwards
    • the first time you use this, you will be asked to set the command
    • this can be used to set test a function you're writing
  • sR

    • clear the command assigned on the current definition

On your first invocation of a ghci.vim command, you will be asked to choose a
tmux pane.

添加新评论