repl.vim


Ⅰ. 插件描述

irb, ghci, and anything else. in Vim.

Ⅱ. 基本信息

创建日期:  2010-09-21
使用用户:  12
Github星:  47
插件作者:  ujihisa

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# repl.vim

Open the interactive environment with the code you are writing.

example

Ruby Example

You are writing the following code in an unnamed buffer.

class C
  def self.f(x)
    x + 1
  end
end

Now you want to try running the code in an interactive environment. Usually you are supposed to (1) save the code on somewhere, (2) open a terminal, (3) run irb -r {the-file}.

If you already installed repl.vim, you just have to run :Repl or to type <space>i. It opens a buffer that is the environment you wanted.

irb>

You can do

irb> C.f 23
24
irb>

Haskell Example

import Test.HUnit
foo _ = (1, 2)
test1 = TestCase (assertEqual "for (foo 3)," (1,2) (foo 3))
tests = TestList [TestLabel "test1" test1]

Run :Repl without saving the code on a file.

ghci> runTestTT tests

Supports

  • Ruby
  • Haskell
  • Python (You can chose python2 or python3 interpreter)
  • Erlang
  • JavaScript
  • Clojure
  • Idris
  • Racket
  • SWIProlog

Installation

Example for neobundle.vim

Please add the following line into your .vimrc

NeoBundle 'ujihisa/repl.vim'

and run :NeoBundleInstall.

Requirements

Authors

  • Tatsuhiro Ujihisa <ujihisa at gmail com>
  • aiya000 <aiya000.develop at gmail com>

Licence

GPL version 3 or any later version
Copyright (c) Tatsuhiro Ujihisa

添加新评论