PageRenderTime 168ms CodeModel.GetById 156ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms


XML | 297 lines | 289 code | 6 blank | 2 comment | 0 complexity | faa07954c0aa998a54095cedfceaedc0 MD5 | raw file
  1<!-- jEdit buffer-local properties: -->
  2<!-- :tabSize=1:indentSize=1:noTabs=true: -->
  4<chapter id="starting"><title>Starting jEdit</title>
  5 <sect1 id="conventions"><title>Conventions</title>
  6  <para>
  7   Several conventions are used throughout jEdit's user interface and
  8   this manual. They will be described here.
  9  </para>
 10  <para>
 11   When a menu item selection is being described, the
 12   top level menu is listed first, followed by successive levels of submenus,
 13   finally followed by the menu item itself. All menu components are separated
 14   by greater-than symbols (<quote>&gt;</quote>). For example,
 15   <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Scroll
 16   to Current Line</guimenuitem> refers to the <guimenuitem>Scroll to Current
 17   Line</guimenuitem> command contained in the
 18   <guisubmenu>Scrolling</guisubmenu> submenu of the <guimenu>View</guimenu> menu.
 19  </para>
 20  <para>
 21   As with many other applications, menu items that end with
 22   ellipsis (...) display dialog boxes or windows when invoked.
 23  </para>
 24  <para>
 25   Many jEdit commands can be also be invoked using keystrokes. This speeds
 26   up editing by letting you keep your hands on the keyboard. Not all
 27   commands with keyboard shortcuts
 28   are accessible with one key stroke; for example, the
 29   keyboard shortcut for <guimenuitem>Scroll to Current Line</guimenuitem> is
 30   <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
 31   <keycombo><keycap>Control</keycap><keycap>J</keycap></keycombo>. That is, you
 32   must first
 33   press <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>, followed by
 34   <keycombo><keycap>Control</keycap><keycap>J</keycap></keycombo>.
 35  </para>
 36  <para>
 37   In many dialog boxes, the default button (it has a heavy outline, or a
 38   special border, depending on your look and feel) can be activated by
 39   pressing <keycap>Enter</keycap>. Similarly, pressing
 40   <keycap>Escape</keycap> will usually close a dialog box.
 41  </para>
 42  <para>
 43   Finally, some user interface elements (menus, menu items, buttons) have a
 44   certain letter in their label underlined. Pressing this letter in combination
 45   with the <keycap>Alt</keycap> key activates the associated user interface
 46   widget.
 47  </para>
 48  <sidebar><title>MacOS</title>
 49   <para>
 50    jEdit tries to adapt itself to established conventions when running on
 51    MacOS.
 52   </para>
 53   <para>
 54    If you are using MacOS, mentally substitute the modifier keys you see in
 55    this manual as follows:
 56   </para>
 57   <itemizedlist>
 58    <listitem><para>Read <keycap>Control</keycap> as <keycap>Command</keycap>
 59    </para></listitem>
 60    <listitem><para>Read <keycap>Alt</keycap> as <keycap>Option</keycap>
 61    </para></listitem>
 62   </itemizedlist>
 63   <para>
 64    If you only have a one-button mouse, a right button click (to show a
 65    context menu, and so on) can be simulated by holding down
 66    <keycap>Control</keycap> while clicking. A middle button click (to insert
 67    the most recent selection in the text area) can be simulated by
 68    holding down <keycap>Option</keycap> while clicking.
 69   </para>
 70  </sidebar>
 71 </sect1>
 72 <sect1 id="starting-any-os"><title>Platform-Independent Instructions</title>
 73  <para>
 74   Exactly how jEdit is started depends on the operating system;
 75   on Unix systems, usually you would
 76   run the <quote>jedit</quote> command at the command line,
 77   or select jEdit from a menu; on Windows, you might
 78   use the jEditLauncher package, which is documented in
 79   <xref linkend="starting-windows" />.
 80  </para>
 81  <para>
 82   If jEdit is started while another copy is already running, control is
 83   transferred to the running copy, and a second instance is not loaded.
 84   This saves time and memory if jEdit is started multiple times.
 85   Communication between instances of jEdit is implemented using
 86   TCP/IP sockets; the initial instance is known as the
 87   <firstterm>server</firstterm>, and subsequent invocations are
 88   <firstterm>clients</firstterm>.
 89  </para>
 90  <para>
 91   If the <command>-background</command> command line switch is specified,
 92   jEdit will continue running and waiting for client requests even
 93   after all editor windows are closed. The advantage of background mode
 94   is that you can open and close jEdit any number of times, only having
 95   to wait for it to start the first time. The downside of background
 96   mode is that jEdit will continue to consume memory when no windows
 97   are open.
 98  </para>
 99  <para>
100   For more information about command line switches that control the
101   server feature, see <xref linkend="cli-usage" />.
102  </para>
103  <para>
104   Unlike other applications, jEdit automatically loads any files that were
105   open last time in was used, so you can get back to work immediately, without
106   having to find the files you are working on first. This feature can be
107   disabled in the <guibutton>Loading and Saving</guibutton> pane of the
108   <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
109   dialog box; see <xref linkend="global-opts" />.
110  </para>
111  <sidebar><title>The edit server and security</title>
112   <para>
113    Not only does the server pick a random TCP port number on startup,
114    it also requires that clients provide an <firstterm>authorization
115    key</firstterm>; a randomly-generated number only accessable to
116    processes running on the local machine.
117    So not only will <quote>bad guys</quote> have to guess a 64-bit integer,
118    they will need to get it right on the first try; the edit server
119    shuts itself off upon receiving an invalid packet.
120   </para>
121   <para>
122    In environments that demand absolute security, the edit server can be
123    disabled by specifying the <command>-noserver</command> command line switch.
124   </para>
125  </sidebar>
126 </sect1>
127 <sect1 id="starting-windows"><title>Starting jEdit on Windows</title>
128  <para>
129   On Windows, jEdit comes with <emphasis>jEditLauncher</emphasis> - an optional
130   package of components that make it easy to start jEdit, manage its command
131   line settings, and launch files and macro scripts.
132  </para>
134  <para>
135   The jEditLauncher package provides three shortcuts for running jEdit:  one in
136   the desktop's <guilabel>Start</guilabel> menu, a entry in the Programs menu, and
137   a third shortcut on your desktop.  Any of these may be deleted or moved without
138   affecting jEdit's operation.  To launch jEdit, simply select one of these shortcuts
139   as you would for any Windows application.
140  </para>
142  <para>
143   The jEditLauncher package includes a utility for changing the command line
144   parameters that are stored with jEditLauncher and used everytime it runs jEdit.
145   You can change the Java interpreter used to launch jEdit, the amount of heap memory,
146   the working directory and other command line parameters.  To make these changes,
147   select <guilabel>Set jEdit Parameters</guilabel> from the jEdit group in
148   the Programs menu, or run <userinput>jedit /p</userinput> from a command
149   line that has jEdit's installation directory in its search path.  A dialog
150   will appear that allows you to change and save a new set of command line
151   parameters.
152  </para>
154  <para>
155   The package also adds menu items to the context or <quote>right-click</quote>
156   menu displayed by the Windows shell when you click on a file item in the
157   desktop window, a Windows Explorer window or a standard file selection dialog.
158   The menu entries allow  you to open selected files in jEdit, starting the
159   application if necessary. It will also allow you to open all files in a
160   directory with a given extension with a single menu selection. If a BeanShell
161   macro script with a <filename>.bsh</filename> extension is selected, the menu
162   includes the option of running that script within jEdit. If you have the
163   <application>JDiff</application> plugin installed with jEdit, you can also
164   select two files and have jEdit compare them in a side-by-side graphical display.
165  </para>
167  <para>
168   For a more detailed description of all features found in
169   the jEditLauncher package, see <xref linkend="launcher-guide"/>.
170  </para>
171 </sect1>
173 <sect1 id="cli-usage"><title>Command Line Usage</title>
174  <para>
175   On operating systems that support a command line, jEdit can be passed
176   various arguments to control its behavior.
177  </para>
178  <para>
179   If you are using <application>jEditLauncher</application>
180   to start jEdit on Windows, only file names can be specified
181   on the command line; the parameters documented below must be set as described
182   in <xref linkend="launcher-starting" />.
183  </para>
184  <para>
185   When opening files from the command line, a line number or marker to
186   position the caret on can be specified like so:
187  </para>
188  <screen><prompt>$ </prompt><userinput>jedit +line:10</userinput>
189<prompt>$ </prompt><userinput>jedit thesis.tex +marker:c</userinput></screen>
190  <para>
191   A number of options can also be specified to control several obscure features.
192   They are listed in the following table.
193  </para>
194  <informaltable>
195   <tgroup cols="2">
196    <colspec colnum="1" colwidth="1.5in" />
197    <thead>
198     <row><entry>Option</entry><entry>Description</entry></row>
199    </thead>
200    <tbody>
201     <row>
202      <entry>-background</entry>
203      <entry>Runs jEdit in background mode. In background mode,
204      the edit server will continue listening for
205      client connections even after all views are closed.
206      See <xref linkend="starting" />.</entry>
207     </row>
208     <row>
209      <entry>-nogui</entry>
210      <entry>Makes jEdit not open an initial view, and instead only open one
211      when the first client connects. Can only be used in combination with
212      the <command>-background</command> switch. You can use this switch to
213      <quote>pre-load</quote> jEdit when you log in to your computer, for
214      example.
215      </entry>
216     </row>
217     <row>
218      <entry>-norestore</entry>
219      <entry>Disables automatic restore of previously open files on
220      startup. This feature can also be set permanently in the
221      <guibutton>Loading and Saving</guibutton> pane of the
222      <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
223      dialog box; see <xref linkend="global-opts" />.
224      </entry>
225     </row>
226     <row>
227      <entry>-run=<replaceable>script</replaceable></entry>
228      <entry>Runs the specified BeanShell script. There can only be one
229      of these parameters on the command line. See
230      <xref linkend="scripts-command-line" /> for details.</entry>
231     </row>
232     <row>
233      <entry>-server</entry>
234      <entry>Stores the server port info in the file named <filename>server</filename>
235      inside the settings directory.</entry>
236     </row>
237     <row>
238      <entry>-server=<replaceable>name</replaceable></entry>
239      <entry>Stores the server port info in the file named
240      <replaceable>name</replaceable>. File names for this
241      parameter are relative to the settings directory.</entry>
242     </row>
243     <row>
244      <entry>-noserver</entry>
245      <entry>Does not attempt to
246      connect to a running edit server, and does not start one either. For
247      information about the edit server, see <xref linkend="starting" />.</entry>
248     </row>
249     <row>
250      <entry>-settings=<replaceable>dir</replaceable></entry>
251      <entry>Loads and saves the user-specific settings from
252      the directory named <replaceable>dir</replaceable>, instead of the
253      default <filename><replaceable>user.home</replaceable>/.jedit</filename>.
254      <replaceable>dir</replaceable> will
255      be created if it does not exist. Has no effect
256      when connecting to another instance via the edit server.</entry>
257     </row>
258     <row>
259      <entry>-nosettings</entry>
260      <entry>Starts jEdit without loading user-specific settings.
261      See <xref linkend="settings-directory" />.</entry>
262     </row>
263     <row>
264      <entry>-noplugins</entry>
265      <entry>Causes jEdit to not load any plugins.
266      See <xref linkend="using-plugins" />. Has no effect
267      when connecting to another instance via the edit server.</entry>
268     </row>
269     <row>
270      <entry>-nostartupscripts</entry>
271      <entry>Causes jEdit to not run any startup scripts.
272      See <xref linkend="startup-scripts" />.
273      Has no effect
274      when connecting to another instance via the edit server.</entry>
275     </row>
276     <row>
277      <entry>-usage</entry>
278      <entry>Shows a brief command line usage message without starting
279      jEdit.
280      This message is also shown if an invalid switch was specified.</entry>
281     </row>
282     <row>
283      <entry>-version</entry>
284      <entry>Shows the version number without starting jEdit.</entry>
285     </row>
286     <row>
287      <entry>- -</entry>
288      <entry>Specifies the end of the command line switches. Further
289      parameters are treated as file names, even if they begin with
290      a dash. Can be used to open files whose names start with a
291      dash, and so on.</entry>
292     </row>
293    </tbody>
294   </tgroup>
295  </informaltable>
296 </sect1>