pipe2eval


Ⅰ. 插件描述

REPL inside vim

Ⅱ. 基本信息

创建日期:  2012-12-06
使用用户:  13
Github星:  72
插件作者:  zweifisch

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# pipe2eval

simple REPL inside vim

supports: python, php, coffee, mysql, mongodb, redis, sh, go, javascript, ruby, elixir ...

demos

coffeescript

coffeescript

install

via vundle

Bundle "zweifisch/pipe2eval"

tempfiles are put to /dev/shm/ by default, export PIP2EVAL_TMP_FILE_PATH to
override.

On Mac OS X, /dev/ is highly locked down permissions wise. If you're on OS X it's recommended to use another folder, such as /tmp/shms or similar (you'll have to create it). To this by adding export PIP2EVAL_TMP_FILE_PATH=/tmp/shms to your Bash/ZSH RC file.

usage

press v<space> to evaluate current line, vip<space> to evaluate a paragraph

to specify a diffrent filetype use the Pipe2 command :Pipe2 redis, :Pipe2 mongo ...

evaluate an empty line will clear the context

key mappings

By default, pipe2eval maps <Space> in Visual mode with:

  vmap <buffer> <Space> ':![pipe2eval dir]/plugin/pipe2eval.sh text<CR><CR>'

This mapping can be customized by setting g:pipe2eval_map_key. For example:

  let g:pipe2eval_map_key = '<Leader>p2e'

specify a mysql connection

-- hostname localhost
-- username root
-- password secret
-- database test

specify a mongodb connection

// host localhost
// port 27017
// db test

mongodb commands

//> dbs
//> collections
//> version
//> status
//> status mem
//> connections
//> session

special commands for shell

evaluate commands on a remote maschine

#> set ssh dbserver1
uptime

end it

#> set ssh

c

v<space> to complie and run current file

passing arguments

// arg1 arg2

sqlite

:Pipe2 sqlite

-- file /path/to/sqlite3.db

.mode line
select * from table limit 1;

rust/go

v<space> to complie and run current file

添加新评论