PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre3/doc/users-guide/basics.xml

#
XML | 246 lines | 243 code | 1 blank | 2 comment | 0 complexity | 85c3ccc4364fab49e60b05a6df2e4417 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=1:noTabs=true: -->
  3. <chapter id="basics"><title>jEdit Basics</title>
  4. <sect1 id="buffers"><title>Buffers</title>
  5. <para>
  6. Several files can be opened and edited at once.
  7. Each open file is referred to as a <firstterm>buffer</firstterm>.
  8. The combo box above the text area selects the buffer to edit.
  9. Different emblems are displayed next to buffer names in the list,
  10. depending the buffer's state;
  11. a red disk is shown for buffers with unsaved changes,
  12. a lock is shown for read-only buffers,
  13. and a spark is shown for new buffers which don't yet exist on disk.
  14. </para>
  15. <para>
  16. In addition to the buffer combo box, various commands can also be
  17. used to select the buffer to edit.
  18. </para>
  19. <para>
  20. <guimenu>View</guimenu>&gt;<guimenuitem>Go to Previous Buffer</guimenuitem>
  21. (keyboard shortcut: <keycombo><keycap>Control</keycap><keycap>Page Up</keycap>
  22. </keycombo>) switches to the previous buffer in the list.
  23. </para>
  24. <para>
  25. <guimenu>View</guimenu>&gt;<guimenuitem>Go to Next Buffer</guimenuitem>
  26. (keyboard shortcut: <keycombo><keycap>Control</keycap><keycap>Page Down</keycap>
  27. </keycombo>) switches to the next buffer in the list.
  28. </para>
  29. <para>
  30. <guimenu>View</guimenu>&gt;<guimenuitem>Go to Recent Buffer</guimenuitem>
  31. (keyboard shortcut: <keycombo><keycap>Control</keycap><keycap>`</keycap></keycombo>)
  32. switches to the buffer that was being edited prior to the current one.
  33. </para>
  34. <sidebar><title>Memory usage</title>
  35. <para>
  36. The maximum number of open buffers depends on available <firstterm>Java
  37. heap memory</firstterm>. Each buffer requires the memory of
  38. approximately two and a half it's size on disk. This overhead is caused
  39. by the file being stored internally as Unicode (see
  40. <xref linkend="encodings" />), and the fact that additional information,
  41. such as line numbers, also needs to be stored.
  42. </para>
  43. <para>
  44. The status bar at the bottom of the view displays used and total Java
  45. heap memory; see <xref linkend="status-bar" /> for details. This can give
  46. you a rough idea of how much memory the currently opened files are using.
  47. The Java heap grows if it runs out of room; but it only grows to a certain
  48. maximum size, and attempts to allocate Java objects that would grow the
  49. heap beyond this size fail with out-of-memory errors.
  50. </para>
  51. <para>
  52. One side-effect of this is that if the maximum heap size is set too low,
  53. opening large files or performing other memory-intesive operations can
  54. fail, even if you have a lot of system memory free. The solution is to
  55. change the Java heap size.
  56. </para>
  57. </sidebar>
  58. </sect1>
  59. <sect1 id="views"><title>Views</title>
  60. <para>
  61. Each editor window is known as a <firstterm>view</firstterm>.
  62. It is possible to have multiple views open at once, and each view can
  63. be split into multiple panes.
  64. </para>
  65. <para>
  66. <guimenu>View</guimenu>&gt;<guimenuitem>New View</guimenuitem> creates a new view.
  67. </para>
  68. <para>
  69. <guimenu>View</guimenu>&gt;<guimenuitem>Close View</guimenuitem> closes the
  70. current view. If only one view is open, closing it will exit jEdit,
  71. unless background mode is on; see <xref linkend="starting" /> for information
  72. about starting jEdit in background mode.
  73. </para>
  74. <para>
  75. <guimenu>View</guimenu>&gt;<guimenuitem>Split
  76. Horizontally</guimenuitem>
  77. (shortcut: <keycombo><keycap>Control</keycap><keycap>2</keycap></keycombo>)
  78. splits the view into two text areas, above each other.
  79. </para>
  80. <para>
  81. <guimenu>View</guimenu>&gt;<guimenuitem>Split
  82. Vertically</guimenuitem>
  83. (shortcut: <keycombo><keycap>Control</keycap><keycap>3</keycap></keycombo>)
  84. splits the view into two text areas, next to each other.
  85. </para>
  86. <para>
  87. <guimenu>View</guimenu>&gt;<guimenuitem>Unsplit</guimenuitem>
  88. (shortcut: <keycombo><keycap>Control</keycap><keycap>1</keycap></keycombo>)
  89. removes all but the current text area from the view.
  90. </para>
  91. <para>
  92. When a view is split, editing commands operate on the text area that
  93. has keyboard focus. To give a text area keyboard focus, click in it
  94. with the mouse, or use the following commands.
  95. </para>
  96. <para>
  97. <guimenu>View</guimenu>&gt;<guimenuitem>Go to
  98. Previous Text Area</guimenuitem>
  99. (shortcut: <keycombo><keycap>Alt</keycap><keycap>Page Up</keycap></keycombo>)
  100. shifts keyboard focus to the previous text area.
  101. </para>
  102. <para>
  103. <guimenu>View</guimenu>&gt;<guimenuitem>Go to
  104. Next Text Area</guimenuitem>
  105. (shortcut: <keycombo><keycap>Alt</keycap><keycap>Page Down</keycap></keycombo>)
  106. shifts keyboard focus to the next text area.
  107. </para>
  108. <para>
  109. Clicking the text area with the right mouse button displays a popup menu.
  110. Both this menu and the tool bar at the top of the view offer quick
  111. mouse-based access to frequently-used commands.
  112. The contents of the tool bar and right-click menu can be
  113. changed in the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global
  114. Options</guimenuitem> dialog box.
  115. </para>
  116. <sect2 id="docking"><title>Window Docking</title>
  117. <para>
  118. The file system browser, HyperSearch results window, and many plugin
  119. windows can optionally be docked into the view. This can be
  120. configured in the <guibutton>Docking</guibutton> pane of the
  121. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  122. dialog box; see <xref linkend="global-opts" />.
  123. </para>
  124. <para>
  125. When windows are docked into the view, strips of buttons are shown in the
  126. left, right, top, and bottom sides of the text area. Each strip contains
  127. buttons for the windows docked in that location, as well as a close box.
  128. Clicking a window's button shows that dockable window; clicking the close
  129. box hides the window again.
  130. </para>
  131. <para>
  132. The commands in the <guimenu>View</guimenu>&gt;<guisubmenu>Docking</guisubmenu>
  133. menu (shortcuts: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  134. <keycap>1</keycap>, <keycap>2</keycap>, <keycap>3</keycap>, <keycap>4</keycap>)
  135. provide keyboard equivalents for the close boxes.
  136. </para>
  137. </sect2>
  138. <sect2 id="status-bar"><title>The Status Bar</title>
  139. <para>
  140. A <firstterm>status bar</firstterm> at the bottom of the view displays the
  141. following information, from left to right:
  142. </para>
  143. <itemizedlist>
  144. <listitem><para>The line number containing the caret</para></listitem>
  145. <listitem><para>The column position of the caret, with the leftmost column
  146. being 1.</para>
  147. <para>
  148. If the line contains tabs, the <firstterm>file</firstterm> position (where a hard
  149. tab is counted as one column) is shown first, followed by the
  150. <firstterm>screen</firstterm> position (where each tab counts for the number of
  151. columns until the next tab stop).
  152. </para>
  153. <para>
  154. Double-clicking on the caret location indicator displays the
  155. <guimenu>Edit</guimenu>&gt;<guimenuitem>Go to Line</guimenuitem> dialog
  156. box; see <xref linkend="lines" />.
  157. </para>
  158. </listitem>
  159. <listitem><para>Prompts displayed by commands such as those dealing with
  160. registers and markers (see <xref linkend="text-transfer" /> and <xref
  161. linkend="markers" />), also I/O progress messages (see
  162. <xref linkend="threaded-io" />)</para></listitem>
  163. <listitem><para>The current buffer's edit mode. Double-clicking this
  164. displays the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Buffer
  165. Options</guimenuitem> dialog box. See <xref
  166. linkend="modes" /> and <xref linkend="buffer-opts" />.</para></listitem>
  167. <listitem><para>The current buffer's character encoding. Double-clicking this
  168. displays the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Buffer
  169. Options</guimenuitem> dialog box. See <xref
  170. linkend="encodings" /> and <xref linkend="buffer-opts" />.</para></listitem>
  171. <listitem><para>The current buffer's fold mode; this is either
  172. <quote>none</quote>, <quote>indent</quote> or <quote>explicit</quote>.
  173. Clicking here toggles between the three modes. See <xref linkend="folding" />.
  174. </para></listitem>
  175. <listitem><para>If multiple selection is enabled, the string
  176. <guilabel>multi</guilabel>; otherwise <guilabel>single</guilabel> is shown.
  177. Clicking here or pressing <keycombo><keycap>Control</keycap>
  178. <keycap>\</keycap></keycombo> turns multiple selection on and off. See <xref
  179. linkend="multi-select" />.</para></listitem>
  180. <listitem><para>If overwrite mode is enabled, the string
  181. <guilabel>ovr</guilabel>; otherwise <guilabel>ins</guilabel> is shown.
  182. Clicking here or pressing
  183. <keycap>Insert</keycap> turns overwrite mode on and off. See <xref
  184. linkend="entering-text" />.</para></listitem>
  185. <listitem><para>A Java heap memory usage indicator, that shows used versus
  186. total heap memory, in megabytes. Double-clicking here opens the
  187. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Memory Status</guimenuitem>
  188. dialog box.</para></listitem>
  189. </itemizedlist>
  190. </sect2>
  191. </sect1>
  192. <sect1 id="textarea"><title>The Text Area</title>
  193. <para>
  194. Text editing takes place in the text area. It behaves in a similar
  195. manner to many Windows and MacOS editors; the few
  196. unique features will be described in this section.
  197. </para>
  198. <para>
  199. The text area will automatically scroll up or down if the caret is moved
  200. closer than three lines to the first or last visible line. This
  201. feature is called <firstterm>electric scrolling</firstterm> and can be disabled
  202. in the <guibutton>Text Area</guibutton> pane of the
  203. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  204. dialog box; see <xref linkend="global-opts" />.
  205. </para>
  206. <para>
  207. To aid in locating the caret, the current line is drawn with a
  208. different background color. To make it clear which lines end with
  209. white space, end of line markers are drawn at the end of each line.
  210. Both these features can be disabled in the <guibutton>Text Area</guibutton>
  211. pane of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global
  212. Options</guimenuitem> dialog box.
  213. </para>
  214. <para>
  215. The strip on the left of the text area is called a <firstterm>gutter</firstterm>.
  216. The gutter displays marker and register locations; it will also display
  217. line numbers if the
  218. <guimenu>View</guimenu>&gt;<guimenuitem>Line Numbers</guimenuitem> (shortcut:
  219. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  220. <keycombo><keycap>Control</keycap><keycap>T</keycap></keycombo>) command is invoked.
  221. </para>
  222. </sect1>
  223. <sect1 id="repeat"><title>Command Repetition</title>
  224. <para>
  225. To repeat a command any number of times, invoke
  226. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Repeat Next Command</guimenuitem>
  227. (shortcut:
  228. <keycombo><keycap>Control</keycap><keycap>Enter</keycap></keycombo>) and enter the
  229. desired repeat count, followed by the command to repeat (either a keystroke
  230. or menu item selection). For example,
  231. <quote><keycombo><keycap>Control</keycap><keycap>Enter</keycap></keycombo>
  232. <keycap>1</keycap> <keycap>4</keycap>
  233. <keycombo><keycap>Control</keycap><keycap>D</keycap></keycombo></quote> will delete
  234. 14 lines, and <quote><keycombo><keycap>Control</keycap><keycap>Enter</keycap></keycombo>
  235. <keycap>8</keycap>
  236. <keycap>#</keycap></quote>
  237. will insert <quote>########</quote> in the buffer.
  238. </para>
  239. <para>
  240. If you specify a repeat count greater than 20, a confirmation dialog box will
  241. be displayed, asking if you really want to perform the action. This prevents
  242. you from hanging jEdit by executing a command too many times.
  243. </para>
  244. </sect1>
  245. </chapter>