You have to be somewhat dedicated to use
emacs as an editor these days, it is pretty powerful but a nightmare to configure cf atom or even JEdit. However along with
vim it is probably the only editor that you can properly integrate with
pry. Because it not as lightweight as vim it is just as well that you do not need to close
emacs whilst live editing with pry.
jgem install pry # or jruby -S gem install pry # or if you must use rvm or rbenv not recommended
To make life easy change your
template: class from
configure the editor
Setting editor in
`echo "Pry.config.editor = 'emacs'" > ~/.pryrc`.
start emacs in server mode
M-x server-start (alt-x)
Install the pry gem for use with jruby:-
Now you are set create a test sketch
k9 -c fred 200 200 and start the live session
k9 --live fred.rb
This should start the sketch and boot into a
To get the code listing as shown above enter
$ at the
pry prompt, to edit the empty draw method
edit -p Fred#draw at the
pry prompt once completed save the sketch with Cx Cc (ctrl-x, ctrl-c) and the sketch will be redrawn to to reflect the new content. But the beauty of the setup is that you can repeat the exercise
edit -p Fred#draw will reload emacs buffer with the
saved content that you can continue to edit.
Further emacs configuration
Emacs fanboys interested in further customising emacs for use with JRubyArt should see Jeremy Laviole article on the wiki. If you go down the Jeremy Laviole route you can change your
template: emacs from
template: bare. Otherwise read about pry integration here.