As a developer, one of the tools that makes me more productive is a good text editor. While IDE environments are replete with a wide assortment of powerful editing tools, they often miss the mark on macro customization, binary (hex) viewers and the ability to edit large text files. More recently, my favorite IDE has been reminding me that text files outside my current project are being edited – which is an extreme nuisance. Fortunately, jEdit provides a wealth of text editing capability coupled with a competent BeanShell macro language.

Unfortunately, on Mac OS these capabilities come at a cost – jEdit has historically been a tad fickle to configure for the Mac keyboard bindings. As luck would have it, jEdit 5.2 and later has simplified the keyboard configuration for Mac dramatically.

The main issue is getting support for the Alt key, which Mac users press in combination with arrow keys for document navigation. While jEdit includes a Mac OS X keyboard map, one additional step is required to make this work with the Alt key.

To setup jEdit on Mac with sane keyboard bindings the first step is to modify your startup BeanShell script. Copy the default startup.bsh script from /Applications/jEdit.app/Contents/Java/startup to ~/Library/jEdit/startup.

Edit this file and add the following entries to the end:

Debug.ALT_KEY_PRESSED_DISABLED = false;
Debug.ALTERNATIVE_DISPATCHER = false;

Launch jEdit and select Utilities / Global Options. Under the jEdit group select “Shortcuts” and change the keymap selection to “Mac OS X”.

screen-shot-2016-11-29-at-9-47-24-pm

That’s it. Open a text file for editing and try some of the standard Mac OS key navigation sequences:

Command + Arrow Right Move to the end of a line
Alt + Arrow Right Advance one word to the right

There are other combinations as well, but these give you a good starting point to confirm your setup. Obviously, if you are running jEdit on other platforms (Windows / Linux) you will want to use the keymap that matches your environment best.