PageRenderTime 108ms CodeModel.GetById 60ms app.highlight 9ms RepoModel.GetById 31ms app.codeStats 0ms


XML | 611 lines | 541 code | 57 blank | 13 comment | 0 complexity | e7baf050333df7d154e7463896f6f890 MD5 | raw file
  1<!-- jEdit buffer-local properties:                      -->
  2<!-- :indentSize=4:noTabs=false:maxLineLen=72:tabSize=4: -->
  3<!-- :xml.root=faq.xml:                                  -->
  5<!-- jEdit FAQ                                           -->
  6<!-- Copyright (C) 2003 John Gellene, Kris Kopicki       -->
  8<sect1 id="usage"><title>Usage Questions</title>
 10  This section deals general usage of jEdit, including customisation.
 13<qandaset defaultlabel="qanda">
 15<!--********************************************************* Abrevs -->
 17    <qandadiv id="text-abbrev"><title>Abbreviations</title>
 19      <qandaentry>
 20        <question id="abbrevs-create-onfly"><para>
 21          How can I create abbreviations <quote>on the fly</quote> as I type?
 22        </para></question>
 23        <answer><para>
 24          Type the form of abbreviation you wish to use, then without pressing the
 25          <keycap>SPACE</keycap> key, press <keycombo
 26          action="simul"><keycap>CTRL</keycap><keycap>;</keycap></keycombo>.
 27          A dialog will appear for entering text that goes before and after the
 28          editing caret. For example, you can insert an opening HTML or XML tag
 29          before the cursor and its corresponding closing tag after the cursor.
 30          Use the mouse to select <guilabel>Add global</guilabel> or <guilabel>Add
 31          mode-specific</guilabel>. The first choice makes the abbreviation
 32          available for all documents; the second makes it available only in
 33          documents with the same editing mode as the current document. In this
 34          way, you can add abbreviations that operate only a particular class of
 35          documents, for example, Java source files or XML markup. Either way, the
 36          abbreviation will be stored for future use.
 37        </para></answer>
 38      </qandaentry>
 40      <qandaentry>
 41        <question id="abbrevs-expand-type"><para>
 42          How can I have abbreviations expanded automatically as I type?
 43        </para></question>
 44        <answer><para>
 45          Select <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global
 46          Options</guimenuitem>, then select the <guimenuitem>Abbreviations</guimenuitem>
 47          option pane. You will see an checkbox option for <quote>Space bar expands
 48          abbrevs</quote>.  Here you can also add, modify and delete abbreviations on
 49          a global basis or for individual editing modes.
 50        </para></answer>
 51      </qandaentry>
 53    </qandadiv>
 55<!--********************************************************* Clippy -->
 57    <qandadiv id="text-clipboard"><title>Clipboard features</title>
 58      <qandaentry>
 59        <question id="clip-multiple"><para>
 60          Can I copy selections from more than one location in a document
 61          (or more than one document) and paste the aggregate text in one
 62          operation?
 63        </para></question>
 64        <answer><para>
 65            The <guimenuitem>Cut Append</guimenuitem>
 66            (<keycombo
 67            action="simul"><keycap>CTRL</keycap><keycap>E</keycap></keycombo>&nbsp;
 68            <keycombo action="simul"><keycap>CTRL</keycap><keycap>U</keycap></keycombo>)
 69            and <guimenuitem>Copy
 70            Append</guimenuitem> (<keycombo
 71            action="simul"><keycap>CTRL</keycap><keycap>E</keycap></keycombo>&nbsp;
 72            <keycombo action="simul"><keycap>CTRL</keycap><keycap>A</keycap></keycombo>)
 73            both add the selected text to the existing contents of the Clipboard. A single
 74            <guimenuitem>Paste</guimenuitem>
 75            (<keycombo action="simul"><keycap>CTRL</keycap><keycap>V</keycap></keycombo>)
 76            command will insert the aggregated text at the cursor or in place of an existing
 77            selection.
 78        </para></answer>
 79      </qandaentry>
 81    </qandadiv>
 83<!--********************************************************* Attrib -->
 85   <qandadiv id="file-attributes"><title>File Attributes</title>
 87    <qandaentry>
 88        <question id="dirty-file"><para>
 89            Why does the screen display continue to mark a file as
 90            <quote>dirty</quote> after I undo all changes made to the buffer?
 91        </para></question>
 92        <answer><para>
 93            This is a problem in jEdit 3.2.2 that has been fixed in version 4.0 or newer.
 94            You should upgrade.
 95         </para></answer>
 96     </qandaentry>
 98    <qandaentry>
 99        <question id="file-owner-preserve"><para>
100            Does jEdit preserve file ownership and permissions when it
101            saves files?
102        </para></question>
103        <answer><para>
104          One reason this can be an issue is that by default, jEdit adopts the conservative
105          approach of saving a file to a temporary name before renaming that file
106          to the desired name. This procedure minimizes the risk of crashes
107          causing loss of data, and works without reported problems on local file
108          systems. However, when files are served remotely by FTP, Samba or other means,
109          it may not be possible to preserve file attributes on the
110          server because the newly created temporary file's owner may differ from
111          the owner of the original file on the server.
112        </para>
113        <para>
114          To avoid this problem, you can disable the two-step file saving routine. Select
115          <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>, then
116          under <guimenuitem>Loading &amp; Saving</guimenuitem>, clear the checkbox for
117          <guimenuitem>Two-stage save</guimenuitem>.
118        </para></answer>
119    </qandaentry>
121    <qandaentry>
122        <question id="file-linesep-choice"><para>
123            Why does jEdit ignore my choice for line separator
124            characters when I save a file?
125        </para></question>
126        <answer><para>
127            When jEdit saves an existing file, it uses the line separator
128            already used by the file.  The line separator designated in the
129            buffer options or elsewhere is used only for new files.
130        </para></answer>
131    </qandaentry>
133    <qandaentry>
134        <question id="file-autodetect-encoding"><para>
135            Can jEdit auto-detect character encodings when it opens a file?
136        </para></question>
137        <answer><para>
138            Only Unicode can be detected when a file is loaded. For other
139            encodings, you must specify the encoding when the file is loaded
140            if you do not wish to use the default
141            encoding for your operating system.
142        </para>
143        <para>
144            There are a few features that can help you navigate through encoding
145            issues. You can select the encoding you wish to use from <guisubmenu>
146            Encoding</guisubmenu> in the <guimenu>Commands</guimenu> menu of the
147			File System Browser.
148            You can also designate a default encoding in the <guimenuitem>Loading
149            &amp; Saving</guimenuitem> pane of the Global Options dialog; if you do
150            not, jEdit adopts your operating system's default encoding as its own
151            default. You can change the encoding used to save an individual file by
152            selecting <guimenu>Utilities</guimenu>&gt;<guimenuitem>Buffer
153            Options</guimenuitem> and changing the current buffer's properties.
154            Finally, jEdit keeps track of the encodings used in the files named in
155            the <guimenu>File</guimenu>&gt;<guimenuitem>Recent Files</guimenuitem>
156            drop-down list.
157         </para>
158         <para>
159            These features allow you to minimize the attention given to character
160            encodings, but you must still pay some attention if you do not want
161            to use default settings.
162        </para></answer>
163    </qandaentry>
164    <qandaentry>
165      <question id="file-euro-char"><para>
166        I'm using the iso-8859-1 character encoding.  How do I type and save the
167        Euro sign (<quote>&#x20ac;</quote>)?
168      </para></question>
169      <answer><para>
170        You need to use instead the iso-8859-15 character set, which is a modification
171        of iso-8859-1 that includes the Euro sign and some Finnish and French characters.
172        The Euro sign represents character value 0xA4 in this 8-bit set. To open a file
173        manually using this encoding, select <guimenu>File</guimenu>&gt;<guimenuitem>Open...
174        </guimenuitem>, and select <guimenuitem>ISO8859_15</guimenuitem> from <guimenu>
175		Commands</guimenu>&gt;<guisubmenu>Enconding</guisubmenu> before opening the file.
176        </para>
177        <para>
178          There is a startup script in the <quote>Downloads</quote> area of
179          <ulink url="">jEdit Community</ulink>
180          named <filename>euro.bsh</filename> that can be used as a startup script to
181          help simplify the insertion of the Euro symbol if your keyboard currently lacks
182          a dedicated key.
183        </para></answer>
184      </qandaentry>
185   </qandadiv>
187<!--********************************************************** Files -->
189    <qandadiv id="file-manage"><title>File Management</title>
191    <qandaentry>
192        <question id="open-dnd"><para>
193            How can I open files in jEdit using drag and drop?
194        </para></question>
195        <answer><para>
196            Try installing the Drag and Drop plugin using the Plugin Manager
197            feature. It works with most (but not all) combinations of operating
198            systems and current Java runtime environments.
199        </para></answer>
200    </qandaentry>
202    <qandaentry>
203        <question id="add-favorites"><para>
204            How do I add and remove directories to the list of
205            <quote>favorites</quote> in jEdit's File System Browser?
206        </para></question>
207        <answer><para>
208            To add a directory to the list of favorites, navigate so that
209            the directory is at the top of the tree displayed in the File System
210            Browser window, click the <guimenuitem>Favorites</guimenuitem> button,
211            and select
212            <guimenuitem>Add to favorites</guimenuitem> from the resulting menu.
213            To delete a directory from the favorites list, use the same menu
214            to go to the favorites list. Right-click on the directory to
215            be deleted and select <guimenuitem>Delete</guimenuitem>.
216            This operation will delete the directory from the list of
217            favorites but will have no effect on the directory itself.
218        </para></answer>
219    </qandaentry>
221    <qandaentry>
222        <question id="associate-files"><para>
223            How do I associate particular file types with jEdit so I can open them
224            by double clicking their icons in Windows Explorer?
225        </para></question>
226        <answer><para>
227            If you are using jEditLauncher, you associate the file extension with
228            <replaceable>[full path]</replaceable><userinput>\jedit.exe
229            &quot;%1&quot;</userinput>.
230        </para>
231        <para>
232            The jEditLauncher package for Windows includes a custom
233            context menu handler.  It will provide menu items for
234            using jEdit any time you right-click on a file icon in
235            Windows Explorer or a Windows file menu.  This feature does
236            not interfere with any existing file associations.
237        </para></answer>
238     </qandaentry>
240    <qandaentry>
241        <question id="open-restrict-dir"><para>
242            Can I restrict jEdit to opening and saving files in a single directory
243            without changing file permissions?
244        </para></question>
245        <answer><para>
246            The easiest way to get this kind of behavior is to use macros that open
247            the Virtual File Browser to a specific, fixed directory, and then
248            change the default keyboard shortcuts for opening and saving files to
249            run these macros.
250        </para></answer>
251     </qandaentry>
253    <qandaentry>
254        <question id="filename-uc-to-lc"><para>
255            On Windows, how can I change the name of my file from
256            <filename>myfile.txt</filename> to <filename>MyFile.txt</filename>?
257        </para></question>
258        <answer><para>
259            The Windows native file system deals with file names in a
260            case-insensitive manner, so <filename>myfile.txt</filename> and
261            <filename>MyFile.txt</filename> refer to the same file. As a result, the
262            jEdit file browser treats both spellings identically and does not
263            make a name change. Using our example, the easiest workaround is to
264            rename the file in two steps: first to <filename>_myfile.txt</filename>,
265            then to <filename>MyFile.txt</filename>.
266        </para></answer>
267     </qandaentry>
269     <qandaentry>
270        <question id="file-delete-recurse"><para>
271            Can I recursively delete a directory's files in jEdit's
272            File Browser?
273        </para></question>
274        <answer><para>
275            No. The feature is being planned for inclusion in a future
276            jEdit version.  The fastest way to do this in the current
277            jEdit version is to use the Console plugin and a native
278            command.
279        </para></answer>
280     </qandaentry>
282   </qandadiv>
284<!--*********************************************************** Text -->
286    <qandadiv id="text-format"><title>Formatting text</title>
288      <qandaentry>
289        <question id="text-indent"><para>
290          How do I indent or unindent selections of text?
291        </para></question>
292        <answer><para>
293            Using jEdit's default configuration, you can indent a selection of text
294            by pressing <keycombo
295            action="simul"><keycap>ALT</keycap><keycap>RIGHT</keycap></keycombo>.
296            Unindent a selection by pressing
297            <keycombo action="simul"><keycap>ALT</keycap><keycap>LEFT</keycap></keycombo>.
298        </para></answer>
299      </qandaentry>
302	<question id="text-line-numbers">
303		<para>
304			Is there a way to automatically view line numbers when a buffer is opened?
305		</para>
306	</question>
307	<answer>
308		<para>
309			<guimenuitem>Select Utilities&gt;Global Options</guimenuitem>, and in
310			the <guimenuitem>Gutter</guimenuitem> option pane select
311			the <guimenuitem>Line Numbering</guimenuitem> check box.
312		</para>
313	</answer>
318	<question id="text-display-lucida">
319		<para>
320			With JDK 1.3 and Lucida Console font I have problems displaying syntax
321			highlighting text. Sometimes the fonts become italicized or bold without any
322			reason.
323		</para>
324	</question>
325	<answer>
326		<para>
327			The Lucida Console font does not come in a bold style. Various platforms and
328			native applications will render the bold style by overprinting, but this appears
329			not to work correctly in your installation. Unfortunately, there is nothing
330			jEdit can do about this, and the best thing to do is to select another font.
331		</para>
332	</answer>
337	<question id="smart-quote">
338		<para>
339			Does jEdit know smart quotes? In .tex files I would like to use
340      <userinput>``</userinput> or <userinput>''</userinput>
341			instead of <userinput>&quot;</userinput>.
342		</para>
343	</question>
344	<answer>
345		<para>
346			While jEdit can display any character provided by a supported encoding set and
347			enter any character supported by a keyboard driver, it does not have the ability
348			to insert <quote>smart quote</quote> pairs automatically as some word processors
349			do. This would require a BeanShell macro to modify quoted text.
350		</para>
351    <para>
352      You also have the option of using a TeX macro (or, in LaTeX, a pair of
353      environment tags) to have the standard double quotation mark
354      <userinput>&quot;</userinput> transformed into the appropriate opening or closing
355      smart quotes without the need to keep track of when quoted text opens or closes.
356    </para>
357	</answer>
361	<question id="text-softwrap">
362		<para>
363			Does jEdit have a <quote>soft</quote> wrap text mode?
364		</para>
365	</question>
366	<answer>
367		<para>
368			Beginning with version 4.0pre4, jEdit has soft wrap capability which can be activated
369      for a specific buffer, specific editing modes, or for all documents by default.
370      In prior versions, both the text wrap feature and the <guimenuitem>Edit&gt;Text&gt;Format
371			Paragraph</guimenuitem> command insert <quote>hard</quote> end of line
372			characters.  This <quote>hard wrap</quote> feature remains available as an option
373      for buffers and editing modes.
374		</para>
375	</answer>
379<question id="text-display-spaces">
381The display of spaces as a character in the editor is annoying. How can I
382disable those small square boxes?
387This is controlled by the WhiteSpace plugin. To change your settings to disable
388display of whitespace characters, select <guimenuitem>Utilities&gt;Global
389Options</guimenuitem>, then select <guimenuitem>Plugin
390options&gt;WhiteSpace</guimenuitem>. You can separately configure the display
391of spaces, tabs, and other whitespace characters.
397	<question id="text-i18n">
398		<para>
399			Does jEdit support i18n?
400		</para>
401	</question>
402	<answer>
403		<para>
404			When editing text documents, jEdit supports any available encoding scheme, and
405			can open files with a specified encoding other than the default encoding of your
406			operating system using the <guimenu>Commands</guimenu>&gt;<guisubmenu>Encoding
407			</guisubmenu> from the File System Browser.
408		</para>
409		<para>
410			With respect to menu labels, message strings and other GUI elements, the jEdit
411			project team currently does not have the resources to maintain multiple property
412			sets in languages other than English, particularly since the development effort
413			is continuing at a rapid pace. There has not been great demand for this in any
414			event. This may be because jEdit is primarily a tool for programmers, and the
415			use of English as a common first or second language is widespread in the global
416			programming community. This decision may be reconsidered when the application
417			has further matured and if more individuals express a willingness to be involved
418			in translation work.
419		</para>
420	</answer>
424	<question id="text-wrap">
425		<para>
426			When using soft wrap, why does it scroll per physical line and not screen line?
427		</para>
428	</question>
429	<answer>
430		<para>
431			This will change in jEdit 4.2.
432		</para>
433	</answer>
438<!--******************************************************* Printing -->
440    <qandadiv id="text-print"><title>Printing text</title>
443	<question id="text-print-improve">
444		<para>
445			What can I do to improve printing performance?
446		</para>
447	</question>
448	<answer>
449		<para>
450			Prior to release of version 1.4 of the Java Development Kit (JDK), printing
451      has been one of the weak
452      areas of the Java platform. If you are using JDK version 1.3, here
453      are a few suggestions on improving printing performance.
454    </para>
455    <para>
456			One simple way to improve printing is to use the InfoViewer plugin to display and
457      print a text file in your favorite Web browser. You can also write a macro that
458      saves a buffer and then passes the buffer's file name (using the method
459			<filename>buffer.getPath()</filename>) to an external print utility. The file
460			<filename>prettyprint.bat</filename> in the
461			Downloads section of <ulink url="">jEdit
462			Community</ulink> is an example of this approach using a
463			Windows batch file and Ghostscript. You can then change the
464			<keycombo action="simul"><keycap>CTRL</keycap><keycap>P</keycap></keycombo>
465			keyboard shortcut to point to your printing macro.
466		</para>
467	</answer>
470    </qandadiv>
472<!--********************************************************* Source -->
474<qandadiv id="source-compile"><title>Compiling source code</title>
476	<question id="compile-java">
477		<para>
478			How do I compile my Java source in JEdit?
479		</para>
480	</question>
481	<answer>
482		<para>
483			There are a number of plugins that you can use to compile Java source code. You
484			can run a Java compiler on the command line in the <quote>System</quote> shell
485			of the <application>Console</application> plugin. If you are using the
486			JCompiler plugin, you	will have a <quote>JCompiler</quote> shell in the
487			<application>Console</application> plugin, and you can run the
488			<userinput>compile</userinput> command for the current file, or the
489			<userinput>compilepkg</userinput> command on all of the current directory's
490			source code files. You can also use the <quote>Ant</quote> shell in the
491			<application>Console</application> plugin or the
492			<application>AntFarm</application> plugin to run complex builds on a project of
493			source code files, using a <filename>build.xml</filename> file to specify build
494			commands and dependencies.
495		</para>
496	</answer>
500	<question id="source-new-editmode">
501		<para>
502			How do I create a new edit mode?
503		</para>
504	</question>
505	<answer>
506		<para>
507			Take a look at the <quote>Writing Edit Modes</quote> section of the User's Guide.
508			Basically, you have to write an XML file containing data on the mode's file
509			extensions and buffer and syntax highlighting properties, then add information
510			about the new mode file to a second XML file containing a catalog of modes.
511		</para>
512	</answer>
516	<question id="source-docbook">
517		<para>
518			Does jEdit support DocBook tags?
519		</para>
520	</question>
521	<answer>
522		<para>
523			The application contains editing modes for both SGML and XML, and there are a
524			number of abbreviations in the SGML mode that create pairs of DocBook tags on
525			the fly. You can auto-complete closing tags with the XML plugin, and with the
526			XInsert or Template plugin you can create multi-layered DocBook elements. The
527			installation macro <filename>Insert_Tag.bsh</filename> is useful for creating
528			or inserting tag pairs in existing text, and there are other macros targeting
529			DocBook available from the <ulink url="">jEdit
530			Community</ulink> web site that you can use or adapt for your own purposes.
531		</para>
532	</answer>
537<!--******************************************************* Settings -->
539<qandadiv id="customize-other"><title>Other Settings and Options</title>
542	<question id="settings-change-font">
543		<para>
544			How can I change the font used for menu labels and other elements of jEdit's
545			user interface?
546		</para>
547	</question>
548	<answer>
549		<para>
550      Select <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>,
551      then the <guimenuitem>Appearance</guimenuitem> option pane.  When you select the
552      <quote>Metal</quote> look and feel you can also select the fonts used for
553      various displayed items.
554		</para>
555	</answer>
559	<question id="settings-add-classpath">
560		<para>
561			I want to add a directory to the classpath. I did this in the standalone
562			BeanShell with ease by using the <classname>addClassPath(String)</classname>
563      method. but this doesn't work in a macro. How could I manage the
564      classpath in jEdit?
565		</para>
566	</question>
567	<answer>
568		<para>
569			The implementation of BeanShell used in jEdit does not use BeanShell's
570			class loader. The script method contained in loadJarClasses.bsh (found in
571			the Downloads section of <ulink url="">jEdit
572			Community</ulink>) should work if you know the path to a specific class
573			file or class archive.
574		</para>
575	</answer>
579	<question id="settings-emacstab">
580		<para>
581			Can I have an emacs style tab key (tab anywhere in a line re-indents it)?
582		</para>
583	</question>
584	<answer>
585		<para>
586			Yes. You can do this by rebinding the <keycode>tab</keycode> key to
587			<command>Indent Selected Lines</command> in the <guimenuitem>Global Options</guimenuitem>.
588		</para>
589	</answer>
593	<question id="settings-unlisted">
594		<para>
595			Are there any hidden features?
596		</para>
597	</question>
598	<answer>
599		<para>
600			Yes. You can access them by binding a shortcut to the action in question. You will find
601			a complete list of available commands under the <guimenuitem>Shortcuts</guimenuitem> area
602			in the <guimenuitem>Global Options</guimenuitem>.
603		</para>
604	</answer>