Skip to content

anakojm/pipe2eval

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I hijacked pipe2eval to make it work as a "notebook" for Python with Markdown and Neorg, since https://github.com/baruchel/vim-notebook is not working.

showcase

You can configure the text between the code and it’s output with the g:pipe2eval_return_word variable.


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

About

REPL inside vim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 95.9%
  • Vim Script 4.1%