sponsor Vim development Vim logo Vim Book Ad

beanshell.vim : Runs the current buffer using BeanShell.

 script karma  Rating 16/8, Downloaded by 2178  Comments, bugs, improvements  Vim wiki

created by
Henry So, Jr.
 
script type
utility
 
description
This script invokes BeanShell ( see http://www.beanshell.org ) on the contents of the current buffer.

The script depends on java (needed to run BeanShell) as well as BeanShell itself.  The java executable should be in your PATH and the BeanShell jar should be in your CLASSPATH in order to use this script in its default configuration.

Press "<Leader>br" and BeanShell will be invoked on the contents of the current buffer (the current buffer will not be written out).  The output from BeanShell will appear in a new window.

BeanShell may also be invoked by entering the command ":BeanShell" or by selecting the "Invoke BeanShell" item from the "Plugin" menu.

Starting with version 1.2, a range may be supplied to the "BeanShell" command and the key command may be activated within a visual block.  Invoking BeanShell this way will cause it to act upon the specified lines rather than the entire buffer.
 
install details
Either drop beanshell.vim into your plugins directory or :source it as needed.

The command to execute BeanShell may be configured by setting the variable "BeanShell_Cmd".  This defaults to "java bsh.Interpreter", but may be set to anything so you can (for example) forego having java in your path and specify it in this variable.

The key command to invoke BeanShell may be configured by mapping some key to <Plug>BeanShell.  For example, to have Shift-F3 invoke BeanShell, enter the command ":map <S-F3> <Plug>BeanShell" (or place this command in your vimrc).
 

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
beanshell.vim 1.2 2006-05-21 6.0 Henry So, Jr. Added support for a range on the "BeanShell" command and for a visual block on the key command.
beanshell.vim 1.1 2002-09-06 6.0 Henry So, Jr. Brought the script more in-line with the suggestions in section 41.9 of the VIM User Manual (:help write-plugin).
beanshell.vim 1.0 2002-09-05 6.0 Henry So, Jr. Initial upload
ip used for rating: 3.149.250.1

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