jEdit can run code like TextMate does?

I am using jEdit on windows for Ruby, and it seems to lack a function to
run code by popping up a new window. (by pressing F5 like in IDLE for
Python, or %-R for mac using TextMate). The result window on TextMate
looks really good by the way.

SpringFlowers AutumnMoon a écrit :

I am using jEdit on windows for Ruby, and it seems to lack a function to
run code by popping up a new window. (by pressing F5 like in IDLE for
Python, or %-R for mac using TextMate). The result window on TextMate
looks really good by the way.
Sure you can, You need to configure the Console plugin to dislay the
“commando” buttons, one of them is Ruby, it’ll start a simple non-ansi
terminal emulation window displaying the output of the interpretation of
the current buffer. Non-ansi means you cannot run “curses” kind of
programs.

J-P

On Sep 19, 11:12 am, Jaypee [email protected] wrote:

SpringFlowers AutumnMoon a écrit :> I am usingjEditon windows for Ruby, and it seems to lack a function to

run code by popping up a new window. (by pressing F5 like in IDLE for
Python, or %-R for mac using TextMate). The result window on TextMate
looks really good by the way.

Sure you can, You need to configure the Console plugin to dislay the
“commando” buttons, one of them is Ruby, it’ll start a simple non-ansi
terminal emulation window displaying the output of the interpretation of
the current buffer. Non-ansi means you cannot run “curses” kind of programs.

that’s weird… do I just go to jEdit -> Plugins -> Plugin Manager ->
Install ?
there is no Console plugin there…

and then it seems like I have to download a third party plugin Console

http://plugins.jedit.org/plugins/?Console

so i downloaded the Console 4.1.2 plugin and jEdit started up saying
Plugin error, it needs 1.3.3?

and i downloaded the Console 4.3.3 plugin instead, and again jEdit
started up saying my jEdit is 4.2final and won’t work with it.

it is a simple thing…

any simpler way?

and i downloaded the Console 4.3.3 plugin instead, and again jEdit
started up saying my jEdit is 4.2final and won’t work with it.

Hmmmm… For me (jEdit 4.3pre9), the plugin manager does list the
Console plugin
(and I have installed it). Now I don’t know much about the history
of jEdit - you are using an old version, and maybe the plugin manager
does not find a Console compatible with your jEdit. This would also
explain why you couldn’t install it manually.

Would upgrading jEdit to the actual version be an option for you?

Otherwise maybe you will be helped better in the jEdit mailing
list (https://lists.sourceforge.net/lists/listinfo/jedit-users)

Ronald

Jaypee wrote:

SpringFlowers AutumnMoon a écrit :

I am using jEdit on windows for Ruby, and it seems to lack a function to
run code by popping up a new window. (by pressing F5 like in IDLE for
Python, or %-R for mac using TextMate). The result window on TextMate
looks really good by the way.

Sure you can, You need to configure the Console plugin to dislay the
“commando” buttons, one of them is Ruby, it’ll start a simple non-ansi
terminal emulation window displaying the output of the interpretation of
the current buffer. Non-ansi means you cannot run “curses” kind of
programs.

finally it installed after getting the “errorlist” plug-in…
but the Plugins -> Console -> Commando
doesn’t have any Ruby choice.

I even downloaded the Ruby plugin, still not there…

wow… it is more complicated than learning the Singleton pattern.

Hello AutumnMoon,

it’s long ago, I wrote this instruction originally for VHDL. Hope it
helps.
I’m using jEdit 4.3pre9 with Ruby, on Windows, and I like it very
much.
On my side it works like you would have it working, so there is a way
to get it done.

Kind regards,

Axel

Execute a RUBY-file from within jEdit

If you want to execute a RUBY-file from within
jEdit by just pressing for example “F5”, you can try:

Edit the file “…\macros\Misc\Run_Script.bsh” as follows:

Behind: path = buffer.getPath() + " ";
Add: bufferDir = dirname( buffer.getPath() );

Behind:
else if(mode.equals(“python”)) {
execScript(“python”, "python " + path);
}

Add:
else if(mode.equals(“ruby”)) {
execScript(“ruby”, "ruby -w " + path);
// -w -> warnings
}

In jEdit: Utilities > Global Options > Edit Shortcuts: “Macros”

Command: “Run Script” > Click into the field "Alternative

Shortcuts" > Press the F5-Button > OK > OK

Optional, but very handy: Install the Plugin “ErrorList” and the
Plugin “Console”.

It might be worth adjusting:
jEdit > Plugins > Plugins Options… > Console > Error
Patterns > Ruby >

Name: Ruby
Regexp: (\s+from)?\s*(.:[^:]+)\s*:(\d+):?(.*)
Warning regexp: leave empty
Extra lines regexp: leave empty
Filename: $2
Line number: $3
Error message: $4

Test Area (not in jEdit 4.2):
K:/SyncByFlash_WIP/syncbyflash/tmp002.rb :25:in m21': undefined methodopne’ for FileUtils:Module (NoMethodError)
from K:/SyncByFlash_WIP/syncbyflash/tmp002.rb :16:in m2' from K:/SyncByFlash_WIP/syncbyflash/tmp002.rb :11:inm1’
from K:/SyncByFlash_WIP/syncbyflash/tmp002.rb :30
Process ruby exited with code 0

Press Test/Commit (not in jEdit 4.2)

OK > OK

When now pressing “F5” on an open RUBY-file, it will be executed;
Errors are shown by the ErrorList-Plugin, and when clicking
on those errors, jEdit jumps to the relevant line in the sourcecode.

My previous post seems to be lost :(.

The following instruction is quite old, and I’m not sure if
everything is up to date. I’m using jEdit for Ruby-editing
a lot and like it very much (I’m on Windows). And what you
ask for, works for me, both on jEdit 4.2 and 4.3pre9.
Please ask again, if the following Instruction does not
lead to success.

Kind regards,

Axel

Running Ruby from within jEdit

If you want to run a Ruby-file from within
jEdit by just pressing for example “F5”, you can try:

Edit the file Run_Script.bsh" as follows:
(You will find it here:
In jEdit goto Utilies > jEdit Home Directory >
Macros > Misc > Run_Script.bsh )

Behind: path = buffer.getPath() + " ";
Add: bufferDir = dirname( buffer.getPath() );

Behind:
else if(mode.equals(“python”)) {
execScript(“python”, "python " + path);
}

Add:

else if(mode.equals(“ruby”)) {
execScript(“ruby”, "ruby -w " + path);
// or without showing warnings:
// execScript(“ruby”, "ruby " + path);
}

In jEdit: Utilities > Global Options > Edit Shortcuts:
“Macros” > Command: “Run Script” > Click into the field
"Alternative

Shortcuts" > Press the F5-Button > OK > OK

When now pressing “F5” on an open Ruby-file, it will/should be
executed; of course, you must have Ruby installed;

OPTIONAL, but very handy: Install the Plugin “ErrorList”
and the Plugin “Console”.

If You choose to do so, maybe you want to adjust the “Error
patterns”; but try first without changing them, because
even my “Error patterns” are not perfect. (Does anybody
have a better set of error patterns for Ruby??):

jEdit > Plugins > Plugins Options… > Console >
Error Patterns > Ruby >

Name: Ruby
Regexp: \s+from\s(.:[^:]+)\s*:(\d+):?(.*)
Warning regexp: leave empty
Extra lines regexp: leave empty
Filename: $1
Line number: $2
Error message: <-- from here. $3

(On jEdit 4.3, not jEdit 4.2. you must enter a test string
and press a test/check(?) - button now.)

Now: > OK > OK

When now pressing “F5” on an open Ruby-file, it will be
executed; of course, you must have Ruby installed; Errors
are shown by the ErrorList-Plugin, and when clicking on
those errors, jEdit jumps to the relevant line in the
sourcecode.

Gavin K. wrote:

On Sep 18, 1:51 am, SpringFlowers AutumnMoon

If you like TextMate, you might try ‘e’ on Windows.
http://www.e-texteditor.com/

IMO, it’s not nearly as good (but then few things are); but it’s the
closest I’ve found.

wow, it really is good.
the only thing is when i tried to change the Font using “Settings”, it
is not shown. Searching on their forum shows that you need to do it
through “Edit Theme”.

the other thing is that it doesn’t have a “Save Project” or “Close
project” option… even though it has a “Recent Projects” option. Maybe
it is just treating a folder as a project.

On Sep 18, 1:51 am, SpringFlowers AutumnMoon
[email protected] wrote:

I am using jEdit on windows for Ruby, and it seems to lack a function to
run code by popping up a new window. (by pressing F5 like in IDLE for
Python, or %-R for mac using TextMate). The result window on TextMate
looks really good by the way.

If you like TextMate, you might try ‘e’ on Windows.
http://www.e-texteditor.com/

IMO, it’s not nearly as good (but then few things are); but it’s the
closest I’ve found.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs