source: tags/0.12.0/j/doc/aliases.html

Last change on this file was 2, checked in by piso, 22 years ago

Initial checkin.

File size: 2.4 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2
3<html>
4
5<head>
6<title>J User's Guide - Aliases</title>
7<LINK REL="stylesheet" HREF="j.css" TYPE="text/css">
8</head>
9
10<body>
11
12<a href="contents.html">Top</a>
13
14<hr>
15
16<h1>Aliases</h1>
17
18<hr>
19
20<p>
21<a href="commands.html#openFile">openFile</a> and
22<a href="commands.html#executeCommand">executeCommand</a> support the use of
23aliases.
24<p>
25To define an alias, use the command <a href="commands.html#alias">alias</a>,
26which you can invoke using
27<a href="commands.html#executeCommand">executeCommand</a> (mapped by default
28to Alt X).
29<p>
30Usage:
31<pre>
32    alias key=value</pre>
33<p>
34For example:
35<pre>
36    alias notes=/home/peter/notes</pre>
37or
38<pre>
39    alias pf=man perlfunc</pre>
40<p>
41The '=' is optional; a space will do as well. Keys may not contain embedded
42spaces.
43<p>
44If you want to define an alias for the current file, you can use "here" as a
45shortcut:
46<pre>
47    alias notes here</pre>
48<p>
49Once you've defined an alias, you can use the key ("notes" or "pf") instead of
50the value ("/home/peter/notes" or "man perlfunc") with
51<a href="commands.html#openFile">openFile</a> or
52<a href="commands.html#executeCommand">executeCommand</a>. J simply substitues
53the value for the key when you press Enter in the location bar textfield.
54<p>
55To unset an alias, set it to nothing:
56<pre>
57    alias notes=</pre>
58You can bring up a dialog box to edit the value of an alias by invoking
59<a href="commands.html#alias">alias</a> with no arguments or by specifying
60just the key:
61<pre>
62    alias notes</pre>
63<p>
64Aliases are stored in the file ~/.j/aliases, or C:\.j\aliases on Windows,
65unless you specify a different home directory when starting j (see
66<a href="preferences.html">Preferences</a>). You can edit this file to add,
67remove, or modify aliases as long as you maintain the same format. If you use
68j to edit your aliases file, the running instance of j automatically reloads
69your aliases when you save the changes to the file, so it is not necessary to
70restart j in order to pick up the new aliases.
71<p>
72J itself defines three system aliases which may not be changed: "prefs" is an
73alias for j's <a href="preferences.html">preferences file</a>, "aliases" is an
74alias for the file that contains the aliases themselves, and "inbox" is an
75alias for the user's default inbox, if any, as specified in the preferences
76file (see <a href="preferences.html#inbox">inbox</a>).
77
78</body>
79</html>
Note: See TracBrowser for help on using the repository browser.