Ⅰ. 插件描述
↔️ tight ghci integration for vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用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
ghciintegrationSend code directly to
ghciwithout worrying whether or not it's in theIO 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
Mtoghci - character-wise movements will be printed in
ghci, while line-wise will
be entered as a definition
- send a movement command
sL- reload the current buffer in
ghci
- reload the current buffer in
st- get the type of the symbol under the cursor
sTfill 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 asr- sync the current definition to
ghciand 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
- sync the current definition to
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.