https://github.com/zweifisch/pipe2eval
REPL inside vim
https://github.com/zweifisch/pipe2eval
Last synced: 4 months ago
JSON representation
REPL inside vim
- Host: GitHub
- URL: https://github.com/zweifisch/pipe2eval
- Owner: zweifisch
- Created: 2012-12-06T04:52:24.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T05:04:12.000Z (about 8 years ago)
- Last Synced: 2023-04-09T21:22:25.622Z (about 2 years ago)
- Language: Shell
- Size: 811 KB
- Stars: 72
- Watchers: 5
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pipe2eval
simple REPL inside vim
supports: python, php, coffee, mysql, mongodb, redis, sh, go, javascript, ruby, elixir ...
## demos
coffeescript

* [mysql](https://github.com/zweifisch/pipe2eval/raw/master/demos/mysql.gif)
* [mongodb](https://github.com/zweifisch/pipe2eval/raw/master/demos/mongodb.gif)## install
via vundle
```vim
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` to evaluate current line, `vip` 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 `` in Visual mode with:```vim
vmap ':![pipe2eval dir]/plugin/pipe2eval.sh text'
```This mapping can be customized by setting `g:pipe2eval_map_key`. For example:
```vim
let g:pipe2eval_map_key = 'p2e'
```### specify a mysql connection
```sql
-- hostname localhost
-- username root
-- password secret
-- database test
```### specify a mongodb connection
```javascript
// host localhost
// port 27017
// db test
```mongodb commands
```javascript
//> 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` to complie and run current file
passing arguments
```c
// arg1 arg2
```### sqlite
`:Pipe2 sqlite`
```sql
-- file /path/to/sqlite3.db.mode line
select * from table limit 1;
```### rust/go
`v` to complie and run current file