stata+jedit
  1. Dowload this zip archive, and decompress it to your home/user folder. On Windows and Mac, that should be the folder CONTAINING the Desktop and My Documents folders.
  2. Get jEdit here.
  3. Install and run jEdit.
  4. From the Macros menu, Stata submenu, choose ~ setup-reset.
  5. Since some of the appearance options will not take effect until you quit and restart jEdit, you might as well do it now.

Ideally, that would be it.


However, this arrangement requires two lines in your profile.do file , so you'll need to check over the following:

  1. The ~setup-reset macro in jEdit will write the two lines to profile.do in your home/user folder. If that's where you keep your profile.do, or you haven't previously had a profile.do, then no problem. Otherwise, you'll need to copy the text from one file to the other, and then delete the extra file.
  2. The two commands might possibly interfere with something you've already set up —

    • One prefixes the main window title with . (a period).
    • The other adds an item to Stata's user menu, with the keyboard shortcut u.

    Those details are used in transferring control to Stata, and executing the code, respectively. Further changes to the main window title will not cause any problems, as long as the title always begins (or ends?) with ..

    If these bits seem too onerous, they could be changed to suit your preference by editing both profile.do and the vb file described on the platform specific page.


Windows Extras

The (otherwise excellent) fact that jEdit is java-based can cause some extra inconvenience. Below is a listing for a file that can update the Windows registry so that do-files, etc., will have jEdit icons, and open in jEdit when double-clicked. A couple of edits might be required to match this file to your own system:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\jEditFile]
"EditFlags"=hex:00,00,01,00
[HKEY_CLASSES_ROOT\jEditFile\DefaultIcon]
@="C:\\Documents and Settings\\XXXXX\\.jedit\\jfile.ico"
[HKEY_CLASSES_ROOT\jEditFile\Shell]
[HKEY_CLASSES_ROOT\jEditFile\Shell\Open]
[HKEY_CLASSES_ROOT\jEditFile\Shell\Open\Command]
@="C:\Program Files\Java\jre1.5.0_07\bin\javaw.exe" -jar "C:\Program Files\jEdit\jedit.jar" -reuseview "%1"
[HKEY_CLASSES_ROOT\.do]
@="jEditFile"
[HKEY_CLASSES_ROOT\.ado]
@="jEditFile"
[HKEY_CLASSES_ROOT\.mata]
@="jEditFile"
[HKEY_CLASSES_ROOT\.txt]
@="jEditFile"

The first highlighted bit should be your home/user directory, as (way) above.

The second is the path to the Java executable, and the third is the path to jEdit.

The final bit is highlighted to, er, highlight the fact that an entry for .txt files is included, which would cause all your .txt files to be treated as jEdit files. You could delete that bit, or add more extensions.

Here is a zipped version of the file, which you could download, edit — before double-clicking — and then double-click, to update your registry.