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 |
---|
23 | aliases. |
---|
24 | <p> |
---|
25 | To define an alias, use the command <a href="commands.html#alias">alias</a>, |
---|
26 | which you can invoke using |
---|
27 | <a href="commands.html#executeCommand">executeCommand</a> (mapped by default |
---|
28 | to Alt X). |
---|
29 | <p> |
---|
30 | Usage: |
---|
31 | <pre> |
---|
32 | alias key=value</pre> |
---|
33 | <p> |
---|
34 | For example: |
---|
35 | <pre> |
---|
36 | alias notes=/home/peter/notes</pre> |
---|
37 | or |
---|
38 | <pre> |
---|
39 | alias pf=man perlfunc</pre> |
---|
40 | <p> |
---|
41 | The '=' is optional; a space will do as well. Keys may not contain embedded |
---|
42 | spaces. |
---|
43 | <p> |
---|
44 | If you want to define an alias for the current file, you can use "here" as a |
---|
45 | shortcut: |
---|
46 | <pre> |
---|
47 | alias notes here</pre> |
---|
48 | <p> |
---|
49 | Once you've defined an alias, you can use the key ("notes" or "pf") instead of |
---|
50 | the 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 |
---|
53 | the value for the key when you press Enter in the location bar textfield. |
---|
54 | <p> |
---|
55 | To unset an alias, set it to nothing: |
---|
56 | <pre> |
---|
57 | alias notes=</pre> |
---|
58 | You 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 |
---|
60 | just the key: |
---|
61 | <pre> |
---|
62 | alias notes</pre> |
---|
63 | <p> |
---|
64 | Aliases are stored in the file ~/.j/aliases, or C:\.j\aliases on Windows, |
---|
65 | unless you specify a different home directory when starting j (see |
---|
66 | <a href="preferences.html">Preferences</a>). You can edit this file to add, |
---|
67 | remove, or modify aliases as long as you maintain the same format. If you use |
---|
68 | j to edit your aliases file, the running instance of j automatically reloads |
---|
69 | your aliases when you save the changes to the file, so it is not necessary to |
---|
70 | restart j in order to pick up the new aliases. |
---|
71 | <p> |
---|
72 | J itself defines three system aliases which may not be changed: "prefs" is an |
---|
73 | alias for j's <a href="preferences.html">preferences file</a>, "aliases" is an |
---|
74 | alias for the file that contains the aliases themselves, and "inbox" is an |
---|
75 | alias for the user's default inbox, if any, as specified in the preferences |
---|
76 | file (see <a href="preferences.html#inbox">inbox</a>). |
---|
77 | |
---|
78 | </body> |
---|
79 | </html> |
---|