using_jedit
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | using_jedit [2022/11/03 15:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Using jEdit ====== | ||
+ | |||
+ | --- // | ||
+ | |||
+ | This topics follows-on from http:// | ||
+ | |||
+ | A good editor can save weeks of time over a year. Editors such as jEdit and NotePad++ can be fully customized. We will concentrate on jEdit; it is full featured with macros, panes, syntax highlighting, | ||
+ | |||
+ | jEdit macros allow communication between other programs and itself. For example a macro can be written to load the TOPAS technical reference. Another macro can be written to create a new TOPAS input file. After a few dozen macros the editing of INP files and the running of TOPAS becomes much easier. Here's a screen shot of jEdit with an INP file loaded. | ||
+ | |||
+ | {{:: | ||
+ | |||
+ | Notice the three buttons on the top left of the screen (TA, TA-Arrow, New-INP); these are TOPAS specific buttons which has been added to jEdit; they communicate with TOPAS. First Timers should take a few minutes to go through the jEdit menus. On the left of the screen is the Plugin called XInsert. It's at present displaying an XML file that is TOPAS specific. Notice that text files read by TOPAS is shown under the Help tab. Clicking on these file names loads the file into jEdit. Example INP files can be loaded into jEdit by clicking on the example INP file name. There are over 100 examples referenced and each can be speedily run by clicking on the TA-arrow-icon, | ||
+ | |||
+ | **//__jEdit files/ | ||
+ | |||
+ | The following files are necessary for editing INP files, they are zipped up here {{:: | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | jEdit Macros | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | TA icons appearing in jEdit | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | **// | ||
+ | |||
+ | Unzip jEdit.ZIP to a directory. From jEdit run the macro INP-Setup.BSH from the jEdit menu " | ||
+ | |||
+ | **// | ||
+ | |||
+ | Key bindings can be easily changed from the menu option " | ||
+ | |||
+ | {{:j9.jpg}} | ||
+ | |||
+ | The highlighted commands that begin with the text TA are macros written specifically for TOPAS. Suggested key bindings are: | ||
+ | |||
+ | A+` Buffer Switcher | ||
+ | A+. Hypertext search | ||
+ | A+1 Opening block comment | ||
+ | A+2 Closing block comment | ||
+ | A+s XSearch Find/ | ||
+ | A+w Save current | ||
+ | C+PgDn Next buffer | ||
+ | C+PgUp Previous buffer | ||
+ | C+g Go to Line | ||
+ | C+w Close current buffer | ||
+ | C+UpArrow Move up 9 lines (macro up_9) | ||
+ | C+DownArrow Move down 9 lines (macro down_9) | ||
+ | C+0 Unsplit current | ||
+ | C+1 Unsplit all | ||
+ | C+2 Split horizontally | ||
+ | C+3 Split vertically | ||
+ | |||
+ | It is useful to go through these key bindings to get a feel for what is possible. | ||
+ | |||
+ | **__//Using XInsert to write INP files//__** | ||
+ | |||
+ | INP files can be swiftly composed using the XInsert hierarchical menus. Clicking on the items of the XInsert menus runs macros defined in the XInsert XML file (inp.insert.xml). For example, to insert an emission profile, place the cursor at the position where the emission profile is to be inserted and then click on the XInsert " | ||
+ | |||
+ | {{:j2.jpg}} | ||
+ | |||
+ | Selecting CuKa2 produces the following: | ||
+ | |||
+ | {{:: | ||
+ | |||
+ | Thus remembering the syntax of the emission profile as well as the keywords is not necessary. | ||
+ | |||
+ | |||
+ | |||
+ | **__//Using Panes//__** | ||
+ | |||
+ | Panes are similar to windows but they do not overlap; they are very useful when viewing and working with more than one file at a time. For example, when writing an INP file, it's often useful to grab INP text from parts of other files. Here's a screen shot showing three panes with the left pane being then one that is worked on. | ||
+ | |||
+ | {{:: | ||
+ | |||
+ | |||
+ | |||
+ | **__// | ||
+ | |||
+ | Keywords can be completed by pressing Ctrl-b. For example, typing ' | ||
+ | |||
+ | {{:: | ||
+ | |||
+ | |||
+ | |||
+ | **__// | ||
+ | |||
+ | Place the cursor on a word and press Alt+. (ie. Alt and fullstop). | ||
+ | |||
+ | |||
+ | **__// | ||
+ | |||
+ | The Console Plugin is extremely useful for placing a list of file names into an INP file. For example, to get all of the data files in the directory test_examples\Absorption-Edge then the Console Plugin can be used in the following manner. First click on the Console Plugin Button at the bottom of the screen. Then type the following DOS commands and press Return at the end of each line: | ||
+ | |||
+ | cd test_examples\absorption-edge | ||
+ | dir *.raw | ||
+ | |||
+ | Note, when typing the ' | ||
+ | |||
+ | {{:: | ||
+ | |||
+ | Now create a new INP file by clicking on the New-INP icon and copy the file-lines from the Console to the new file. Column select the text to the left of the file names; ie. | ||
+ | |||
+ | {{:: | ||
+ | |||
+ | Press the delete key to have a list of file names only. | ||
+ | |||
+ | |||
+ | |||
+ | **__//Users with Large screens// | ||
+ | |||
+ | Place jEdit and TOPAS side by side on a single screen; the following gives an idea: | ||
+ | |||
+ | {{:: | ||