sponsor Vim development Vim logo Vim Book Ad

replvim.sh : Allow a read eval print loop and vim to play nicely together

 script karma  Rating 13/6, Downloaded by 1393  Comments, bugs, improvements  Vim wiki

created by
Saul Hazledine
 
script type
utility
 
description
UNIX command-line only

Usage : replvim.sh [options] replname code_type file

Runs a screen/vim session on the given file so that one window
holds a repl and another window holds vim.
Hit:
<leader>e    to eval the current expression
<leader>r     to evaluate the given marked range
<leader>f     to evaluate the whole file
ctrl-a <TAB>  to switch windows to the repl
ctrl-a \      to exit everything
Set the leader in vim with
:let mapleader = ","
replacing "," with the key you like the most

Arguments (wrap these in an alias or sh script):
replname   The repl being used (ocaml, bigloo, chicken have been tested)
code_type  Can be 'lisp' for lisp-like or 'ocaml'
file               The file for vim to edit

Options:
--lines n   Use n lines of screen space for the repl
--nopipe   Use files instead of pipes. This can be used when vim 6.3
                    gives FSYNC errors when writing to pipes on some OSes.
--echo      Echo the commands being sent to the repl and allow access
                   to them in the readline history

Requires (on your PATH):
  socat (http://www.dest-unreach.org/socat/)
  screen (http://www.gnu.org/software/screen/)
if you don't have these your life will be much richer for obtaining them

(at saul (dot alien-science org)) welcomes your fixes and extensions

 
install details
install screen
install socat
replvim.sh replname code_type file
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
replvim.sh 0.3 2004-09-28 6.0 Saul Hazledine Fixed issue with FSYNC error message. Opened repl to user input. Added readline support to repl. Added options to echo commands that are sent to repl and to change initial size of repl window.
replvim.sh 0.2 2004-09-12 6.0 Saul Hazledine More sensible handling of lisp expressions.
replvim.sh 0.1 2004-09-03 6.0 Saul Hazledine Tested on Solaris, OpenBSD and Linux.
replvim.sh 0.0 2004-09-02 6.0 Saul Hazledine Initial upload
ip used for rating: 3.142.173.227

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github