PageRenderTime 52ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/doc/FAQ/faq-use.xml

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