Skip to content

Using vim for JRubyArt on RaspberryPI

Martin Prout edited this page Jun 10, 2018 · 3 revisions

Install vim

sudo apt-get install vim

Create a workspace

For a variety of reasons you should create a new folder/directory for your work, and since vim works in a terminal it makes sense to use command line tools:-

mkdir my_sketches
cd my_sketches

Create your first sketch

vim line.rb
line 0, 0, 600, 600

Save and run from vim

Save without quitting

:w

Run your sketch from vim

:!k9 -r %

How did that work?

well k9 -r my_sketch.rb is normally what you might enter to run a sketch, but vim allows you to enter a command that works on the current file using %. Then like vanilla processing your static code gets wrapped in class and run. The default size of a static sketch in JRubyArt is 600 * 600 pixels (this can be changed in ~/.jruby_art/config.yml

On closing sketch you are returned to vim