source: trunk/j/doc/initialization.html @ 2

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

Initial checkin.

File size: 2.0 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2
3<html>
4
5<head>
6<title>init.bsh</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>init.bsh</h1>
17
18<hr>
19
20<p>
21Starting with version 0.11.0, j executes the
22<a href="http://www.beanshell.org">BeanShell</a> script ~/.j/init.bsh (Unix)
23or C:\.j\init.bsh (Windows) on startup if it exists. This is done after the
24user's preferences, theme, and custom key maps (if any) have been loaded.
25<p>
26In principle it is possible to execute arbitrary Java code in init.bsh, but
27only the following commands are officially supported:
28<pre>
29        void globalMapKey(String keyText, String command)
30        void globalUnmapKey(String keyText)
31        void mapKeyForMode(String keyText, String command, String modeName)
32        void unmapKeyForMode(String keyText, String modeName)
33</pre>
34You can use these commands to make minor changes to the default key mappings
35without having to define a full set of custom key maps (see
36<a href="keys.html">Key Mappings</a>).
37<p>
38For these commands, the <code>keyText</code> parameter is the name of the key
39or key combination to be mapped or unmapped (e.g. "F7", "Ctrl Shift G",
40"J"). When in doubt, you can use
41<a href="commands.html#insertKeyText">insertKeyText</a> to insert the
42appropriate text string. The <code>command</code> parameter is the name of the
43command to be mapped (e.g. "openFile", "cyclePaste", "jdkHelp"). The
44<code>modeName</code> parameter is the name of the mode, as displayed in the
45status bar when that particular mode is in effect in the current buffer (e.g.
46"Java", "HTML", "Plain Text").
47<p>
48Some examples:
49<pre>
50        globalMapKey("Mouse-1", "mouseSetPoint");
51        globalUnmapKey("F3");
52        mapKeyForMode("Alt Mouse-1", "mouseFindTag", "Java");
53        unmapKeyForMode("F4", "perl");
54</pre>
55If you make changes to init.bsh while j is running, you can use the command
56<a href="commands.html#evalBuffer">evalBuffer</a> to execute the changed
57script without restarting j.
58</body>
59
60</html>
Note: See TracBrowser for help on using the repository browser.