openFile and executeCommand support the use of aliases.

To define an alias, use the command alias, which you can invoke using executeCommand (mapped by default to Alt X).


    alias key=value

For example:

    alias notes=/home/peter/notes
    alias pf=man perlfunc

The '=' is optional; a space will do as well. Keys may not contain embedded spaces.

If you want to define an alias for the current file, you can use "here" as a shortcut:

    alias notes here

Once you've defined an alias, you can use the key ("notes" or "pf") instead of the value ("/home/peter/notes" or "man perlfunc") with openFile or executeCommand. J simply substitues the value for the key when you press Enter in the location bar textfield.

To unset an alias, set it to nothing:

    alias notes=
You can bring up a dialog box to edit the value of an alias by invoking alias with no arguments or by specifying just the key:
    alias notes

Aliases are stored in the file ~/.j/aliases, or C:\.j\aliases on Windows, unless you specify a different home directory when starting j (see Preferences). You can edit this file to add, remove, or modify aliases as long as you maintain the same format. If you use j to edit your aliases file, the running instance of j automatically reloads your aliases when you save the changes to the file, so it is not necessary to restart j in order to pick up the new aliases.

J itself defines three system aliases which may not be changed: "prefs" is an alias for j's preferences file, "aliases" is an alias for the file that contains the aliases themselves, and "inbox" is an alias for the user's default inbox, if any, as specified in the preferences file (see inbox).