sponsor Vim development Vim logo Vim Book Ad

fvl.vim : Send Lisp code to an interpreter running in a Vim window

 script karma  Rating 39/17, Downloaded by 1592  Comments, bugs, improvements  Vim wiki

created by
Ray Wallace
script type
Fred's Vim Lisp

This plugin allows you to run a Lisp interpreter in a Vim window and send Lisp expressions to it. You can send selected lines, a [count] number of lines, or a range of lines.

fvl.vim defines a handful of commands:
    LispOpen     opens the lisp window and starts the lisp interpreter
    LispClose    close the lisp window and terminate lisp. This happens automatically when the lisp buffer is closed.
    LispRefresh  try and read from lisp when your in a pinch.
    LispDo       like perldo. Evaluate a lisp expression. You MUST escape quotes.
    LispCount    evaluate [count] lines.
    LispRange    evaluate a range of lines.

In practice, all you need to remember is LispDo and possibly LispRange.
I've added the following mapping to my .vimrc file:

map <C-L> :LispRange

That map allows you to hit <C-L> to send a single line to the lisp interpreter, or select a few lines and send them all together.

NOTE: There is already another script that does similar things to fvl.vim, vimscript #221 (VIlisp.vim). What's the difference? Mostly, fvl.vim requires only one file (the plugin file) to work and is a bit easier to setup (imho).
install details
  vim (compiled with +perl and +windows)
  perl Expect module (# cpan Expect)
  gcl, clisp, or some other lisp interpreter

Step 1:
Edit the perl variables at the top of the script file to your liking. Important ones to look at are $LispInterp and $LispPrompt. $LispInterp is the name of the interpreter you'd like to use. $LispPrompt should contain a regurlar expression that matches the prompt that your interpreter issues ("^.*>" will probably work).

Step 2:
Copy the fvl.vim to your vim plugin directory

Step 3:
Add a mapping or two to LispRange and/or LispCount.

You should be all set.

fvl.vim will probably work with any program that runs on a read/evaluate loop if the $LispPrompt variable is set correctly.

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
fvl.vim 1.0 2004-02-08 6.0 Ray Wallace Initial upload
ip used for rating:

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.