Installation

Install jEdit and the console and xml plugins at a minimum, the latter is useful to edit the commando and mode files. Use the plugin manager to install the plugins, and to find other plugins you might like to have (unfortunately the ruby plugin is a bit out of date, but otherwise excellent).

Either clone this repro or use a zipped file, copy the files in the .jedit folder to wherever your .jedit folder is typically ~/.jedit and edit them suit your system see below for JRubyArt for an example.

The macro file k9.bsh

This file lives in ~/.jedit/macros/ folder use this so you you can run, watch from the macros menu

/**
* k9.bsh by monkstone 24 October 2015 
* A jedit bean shell macro, to load environment, and call
* k9 commando menu
*
* You must edit GEM_HOME/GEM_PATH to match your system
* if you use setenv (but usually you wont need to set it)
* example below for ArchLinux with user 'tux'
* Using Oracle jdk installed under /opt
*/

// setenv("JAVA_HOME", "/opt/jdk1.8.0_66");
// setenv("JRUBY_HOME", "/opt/jruby");
// setenv("GEM_HOME", "/home/tux/.gem/ruby/2.2.0");
// setenv("GEM_PATH", "/home/tux/.gem/ruby/2.2.0");
// setenv("PATH", "/usr/bin");
new console.commando.CommandoDialog(view,"commando.k9");

The commando file k9.xml

This file lives in ~/.jedit/console/commando/ you should tune this to match your OS setup

<?xml version="1.0"?>
<!DOCTYPE COMMANDO SYSTEM "commando.dtd">
<!-- Monkstone, 2015-October-25 for JRubyArt-1.0.0+ -->
<COMMANDO>
<UI>
<CAPTION LABEL="Run">
<FILE_ENTRY LABEL="ruby file" VARNAME="file" EVAL="buffer.getName()"/>
</CAPTION>
<CAPTION LABEL="Path to k9">
<ENTRY LABEL="path" VARNAME="k9path" DEFAULT=""/>
</CAPTION>
<CAPTION LABEL="Choose Run/Watch/Version">
<CHOICE LABEL="Select" VARNAME="type" DEFAULT="run" >
<OPTION  LABEL="run" VALUE="run"/>
<OPTION LABEL="watch" VALUE="watch"/>
<OPTION LABEL="version" VALUE="setup"/>
</CHOICE>
</CAPTION>
<CAPTION LABEL="JRuby Opt">
<TOGGLE LABEL="jruby-complete" VARNAME="jruby" DEFAULT="FALSE"/>
</CAPTION>
</UI>

<COMMANDS>
<COMMAND SHELL="System" CONFIRM="FALSE">
<!-- cd to working dir -->

	  buf = new StringBuilder("cd ");
	  buf.append(MiscUtilities.getParentOfPath(buffer.getPath()));
	  buf.toString();
	
</COMMAND>
<COMMAND SHELL="System" CONFIRM="FALSE">

	  buf = new StringBuilder(k9path);
	  buf.append("k9 ");
	  if (jruby){
	      buf.append("--nojruby ");
	  }	 
	  buf.append(type);
	  buf.append(" "); 
	  switch(type){
	  case "run":
	  case "watch":
	      buf.append(file);
	      break;
	  case "setup":
              buf.append("check");
	      break;	  
	  }
	  buf.toString();
	
</COMMAND>
</COMMANDS>
</COMMANDO>

keyboard shortcuts

The macro menu is accessible with Alt c. However you should create a direct shortcut to the macro say Alt k see how in Utilities/Global Options menu.

The k9 popup menu

Use this menu to run/watch your sketch (the current buffer), you only need to enter the path to the k9 executable once (this, the choice of run/watch, and the checkbox setting are ‘remembered’ for you). The filename of the current buffer is displayed for your convenience and need not be entered. You can use the Commands tab to see what commands get sent (eg checked jruby-complete, inserts --nojruby flag). You can also check JRubyArt version and configuration using version remember to change back to run or watch though.