/jeditIDE

jedit IDE howto (example for FriCAS)

Primary LanguagePython

jEdit IDE HowTo

jEdit Homepage:http://www.jedit.org/
Wikipedia:https://en.wikipedia.org/wiki/JEdit

jEdit is a mature programmer's text editor with hundreds (counting the time developing plugins) of person-years of development behind it.

In less than no time it can be configured into an IDE for almost any language. For this HowTo we will use the computer algebra system FriCAS. Hence we assume you have fricas installed and you are using some Lin(ux) or Windows 10/WSL. The editor jEdit can be installed by apt/deb (used below) or by a method described on the jEdit Homepage.

jeditIDE

Install jEdit

$ sudo apt install jedit

$ apt list jedit
Listing... Done
jedit/bionic,bionic,now 5.5.0+dfsg-1 all [installed]

$ jedit -version
jEdit 5.5.0
$ jedit -usage
Start:jEdit
$ jedit &

jedit1

Install Plugins

Mark:[x] the plugins in the Plugin Manager.

jedit2

Mandatory

  • Console
  • ContextMenu
  • ProjectViewer
  • Templates
  • TextFilter
  • GnuRegexp

jedit3

Recommended/Optional

  • BufferList
  • CharacterMap
  • Code2HTML
  • ImageViewer
  • InfoViewer
  • JDiffPlugin
  • MarkdownPlugin
  • SpellCheck

jedit4

Check the appearance

Now you should see some new (docked) windows, BufferList for instance.

jedit5

Click:on BufferList in the right docking area.

It will expand.

jedit6

Same for the Console.

jedit7

Enter:some commands, and check if ~/.jedit is available.
Warning:This is crucial for the further installation.

jedit8

Install an Edit Mode

Copy the mode/spad.xml file to ~/.jedit/modes/ (see below) and add

<MODE NAME="spad" FILE="spad.xml" FILE_NAME_GLOB="*.{spad,input}" />

to the file ~/.jedit/modes/catalog. The code below will just perform these steps.

$ cp -v spad.xml ~/.jedit/modes/

$ export jcat_tmp=~/.jedit/modes/catalog
$ cat $jcat_tmp add_spad_to_catalog.txt > $jcat_tmp
NOTE:Now retart jEdit, i.e. close and reopen (jedit &).

Open a new file

Menu:File -> New In Mode

Find spad (hopefully).

jedit9

Syntax highlighting: Enter some keywords.

The color scheme can be adjusted of course.

jedit10

jedit11

Configure the Console

Plugin -> Console -> compile & run

jedit12

Configure the Context Menu

As above, configure the context menu.

jedit13

Press the [+] button.

jedit14

Look for Run current buffer ...

jedit15

Repeat the above steps in order to add Compile current buffer ...

jedit16

Now the menu item spad (or whatever label you have given) should appear.

jedit17

Installing the Templates

First, copy the templates to the ~/.jedit/templates folder

$ cp -v templates/spad_* ~/.jedit/templates/
'templates/spad_category.vm' -> '/home/kfp/.jedit/templates/spad_category.vm'
'templates/spad_domain.vm' -> '/home/kfp/.jedit/templates/spad_domain.vm'
'templates/spad_package.vm' -> '/home/kfp/.jedit/templates/spad_package.vm'
'templates/spad_unittest.vm' -> '/home/kfp/.jedit/templates/spad_unittest.vm'

Plugins -> Templates -> Template Tree

jedit18

Dock the floating template tree window to the left docking area_.

jedit19

Choose refresh templates, and you will see the installed templates.

jedit20

jedit21

Install the Macros

In this example only one macro will be installed (lookup FriCAS API).

$ mkdir ~/.jedit/macros/FriCAS
$ cp -v  macros/fricas_api.bsh ~/.jedit/macros/FriCAS
'macros/fricas_api.bsh' -> '/home/kfp/.jedit/macros/FriCAS/fricas_api.bsh'

Choose ``Macros -> Rescan Macros`` and you should find the folder ``FriCAS`` containing the macro files (bean shell, .bsh)
``fricas_api``:

jedit22

Add it to the contex menu spad ([+] button)

jedit23

Add a separator for convenience,

jedit24

find the Macros menu entry,

jedit25

and look for fricas_api.

jedit26

Now press OK.

jedit27

We want to use it. Mouse-Select a FriCAS Type (e.g. Integer), and

Menu: spad -> fricas_api

jedit28

should display (in Firefox, otherwise edit the script) the corresponding FriCAS API webpage.

jedit29

Finally, customize jEdit to your needs, e.g. by arranging the dockable windows and so on.

jedit30