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

/jEdit/tags/jedit-4-1-pre5/doc/users-guide/text-edit.xml

#
XML | 1118 lines | 1106 code | 1 blank | 11 comment | 0 complexity | f49d3da87069b8e5e48ad01179084bf3 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

Large files files are truncated, but you can click here to view the full file

  1. <!-- jEdit buffer-local properties: -->
  2. <!-- :tabSize=1:indentSize=1:noTabs=true: -->
  3. <chapter id="editing"><title>Editing Text</title>
  4. <sect1 id="caret"><title>Moving The Caret</title>
  5. <para>
  6. The most direct way to move the caret is to click the
  7. mouse at the desired location in the text area. It can also be moved
  8. using the keyboard.
  9. </para>
  10. <para>
  11. The <keycap>Left</keycap>, <keycap>Right</keycap>, <keycap>Up</keycap> and
  12. <keycap>Down</keycap> keys move the caret in the respective direction, and
  13. the <keycap>Page Up</keycap> and <keycap>Page Down</keycap> keys move the
  14. caret up and down one screenful, respectively.
  15. </para>
  16. <para>
  17. When pressed once, the <keycap>Home</keycap> key moves the caret to the first
  18. non-whitespace character of the current line. Pressing it a second time
  19. moves the caret to the beginning of the current line. Pressing it a third time
  20. moves the caret to the first visible line.
  21. </para>
  22. <para>
  23. The <keycap>End</keycap> key behaves in a
  24. similar manner, going to the last non-whitespace character, the end of
  25. the line, and finally to the last visible line.
  26. </para>
  27. <para>
  28. If there is a selection, <keycap>Home</keycap> and <keycap>End</keycap>
  29. behave the same as above, except that instead of operating on the current
  30. line, they move the caret to the first and last lines of the selection,
  31. respectively.
  32. </para>
  33. <para>
  34. If soft wrap is enabled (see <xref linkend="word-wrap"/>), the first time
  35. they are pressed
  36. <keycap>Home</keycap> and <keycap>End</keycap> only go to the start and end
  37. of the current screen line; the second press moves to the start and end of
  38. the physical line.
  39. </para>
  40. <para>
  41. <keycombo><keycap>Control</keycap><keycap>Home</keycap></keycombo> and
  42. <keycombo><keycap>Control</keycap><keycap>End</keycap></keycombo> move the
  43. caret to the beginning and end of the buffer.
  44. </para>
  45. <para>
  46. More advanced caret movement is covered in
  47. <xref linkend="words" />, <xref linkend="lines" /> and
  48. <xref linkend="paragraphs" />.
  49. </para>
  50. <sidebar><title>The Home and End keys</title>
  51. <para>
  52. If you prefer more traditional behavior for the
  53. <keycap>Home</keycap> and <keycap>End</keycap> keys, you can reassign
  54. the respective keyboard shortcuts in the <guibutton>Shortcuts</guibutton>
  55. pane of the
  56. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>.
  57. </para>
  58. <para>
  59. By default, the shortcuts are assigned as follows:
  60. </para>
  61. <itemizedlist>
  62. <listitem><para><keycap>Home</keycap> is bound to <guimenuitem>Smart
  63. Home</guimenuitem>.</para></listitem>
  64. <listitem><para><keycap>End</keycap> is bound to <guimenuitem>Smart
  65. End</guimenuitem>.</para></listitem>
  66. <listitem><para><keycombo><keycap>Shift</keycap> <keycap>Home</keycap>
  67. </keycombo> is bound to <guimenuitem>Select to Smart
  68. Home Position</guimenuitem>.</para></listitem>
  69. <listitem><para><keycombo><keycap>Shift</keycap> <keycap>End</keycap>
  70. </keycombo> is bound to <guimenuitem>Select to Smart
  71. End Position</guimenuitem>.</para></listitem>
  72. </itemizedlist>
  73. <para>
  74. However you can rebind them to any set of other commands, such as:
  75. </para>
  76. <itemizedlist>
  77. <listitem><para><guimenuitem>Go to Start of White Space</guimenuitem>,</para>
  78. </listitem>
  79. <listitem><para><guimenuitem>Go to End of White Space</guimenuitem>,</para>
  80. </listitem>
  81. <listitem><para><guimenuitem>Go to Start of Line</guimenuitem>,</para>
  82. </listitem>
  83. <listitem><para><guimenuitem>Go to End of Line</guimenuitem>,</para>
  84. </listitem>
  85. <listitem><para>... and so on.</para>
  86. </listitem>
  87. </itemizedlist>
  88. <para>
  89. For more information about changing keyboard shortcuts, see
  90. <xref linkend="global-opts"/>.
  91. </para>
  92. </sidebar>
  93. </sect1>
  94. <sect1 id="selection"><title>Selecting Text</title>
  95. <para>
  96. A <firstterm>selection</firstterm> is a a block of text marked for further
  97. manipulation. Unlike many other applications, jEdit supports both
  98. range and rectangular selections, and several chunks of text can be
  99. selected simultaneously.
  100. </para>
  101. <para>
  102. Dragging the mouse creates a range selection from where the mouse was
  103. pressed to where it was released.
  104. Holding down <keycap>Shift</keycap> while clicking a location in the
  105. buffer will create a selection from the caret position to the clicked
  106. location.
  107. </para>
  108. <para>
  109. Holding down <keycap>Shift</keycap> in addition to a caret movement key
  110. (<keycap>Left</keycap>, <keycap>Up</keycap>, <keycap>Home</keycap>, etc) will
  111. extend the selection in the specified direction. If no selection exists, one
  112. will be created.
  113. </para>
  114. <para>
  115. <guimenu>Edit</guimenu>&gt;<guimenuitem>Select All</guimenuitem> (shortcut:
  116. <keycombo><keycap>Control</keycap><keycap>A</keycap></keycombo>) selects the
  117. entire buffer.
  118. </para>
  119. <para>
  120. <guimenu>Edit</guimenu>&gt;<guimenuitem>Select None</guimenuitem> (shortcut:
  121. <keycap>Escape</keycap>) deactivates the selection.
  122. </para>
  123. <sect2><title>Rectangular Selection</title>
  124. <para>
  125. Dragging with the <keycap>Control</keycap> key held down will create a
  126. rectangular selection. Holding down
  127. <keycap>Shift</keycap> and <keycap>Control</keycap> while clicking a
  128. location in the buffer will create a rectangular selection from the caret
  129. position to the clicked location.
  130. </para>
  131. <para>
  132. It is possible to select a rectangle with zero width but non-zero height.
  133. This can be used to insert a new column between two existing
  134. columns, for example. Such zero-width selections are shown as a thin
  135. vertical line.
  136. </para>
  137. <para>
  138. Rectangles can be deleted, copied, pasted, and operated on using ordinary
  139. editing commands.
  140. </para>
  141. <note>
  142. <para>
  143. Rectangular selections are implemented using character offsets,
  144. not absolute screen positions, so they might not behave as you might
  145. expect if a proportional-width font is being used or if soft wrap is
  146. enabled. For information about changing the font used in the text
  147. area, see <xref linkend="global-opts" />. For information about soft wrap,
  148. see <xref linkend="word-wrap" />.
  149. </para>
  150. </note>
  151. </sect2>
  152. <sect2 id="multi-select"><title>Multiple Selection</title>
  153. <para>
  154. Pressing <keycombo><keycap>Control</keycap> <keycap>\</keycap></keycombo>
  155. turns multiple selection mode on and
  156. off. In multiple selection mode, multiple fragments of text can be selected
  157. and operated on simultaneously, and the text <literal>multi</literal> is shown
  158. in the status bar.
  159. </para>
  160. <para>
  161. While multiple selection mode is active, you can click and drag the mouse
  162. to reposition the caret and create new selections.
  163. </para>
  164. <para>
  165. Various jEdit commands behave differently with multiple selections:
  166. </para>
  167. <itemizedlist>
  168. <listitem><para>Commands that copy text place the contents of
  169. each selection, separated by line breaks, in the specified register.
  170. </para></listitem>
  171. <listitem><para>Commands that insert (or paste) text replace each selection
  172. with the entire text that is being inserted.</para></listitem>
  173. <listitem><para>Commands that filter text (such as <guimenuitem>Spaces to
  174. Tabs</guimenuitem>, <guimenuitem>Range Comment</guimenuitem>, and even
  175. <guimenuitem>Replace in Selection</guimenuitem>) operate on each selection,
  176. in turn.</para></listitem>
  177. <listitem><para>Line-based commands (such as <guimenuitem>Shift Indent
  178. Left</guimenuitem>, <guimenuitem>Shift Indent Right</guimenuitem>, and
  179. <guimenuitem>Line Comment</guimenuitem>) operate on each line that contains
  180. at least one selection.
  181. </para></listitem>
  182. <listitem><para>Caret movement commands that would normally deactivate the
  183. selection (such as the arrow keys, while <keycap>Shift</keycap> is not being
  184. held down), move the caret, leaving the selection as-is.</para></listitem>
  185. <listitem><para>Some older plugins may not support multiple selection at
  186. all.</para></listitem>
  187. </itemizedlist>
  188. <para>
  189. <guimenu>Edit</guimenu>&gt;<guimenuitem>Invert Selection</guimenuitem>
  190. (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  191. <keycap>I</keycap>) selects a set of text chunks such that all text
  192. that was formerly part of a selection is now unselected, and all text that
  193. wasn't, is selected.
  194. </para>
  195. <tip>
  196. <para>
  197. Deactivating multiple selection
  198. mode while a fragmented selection exists will leave the selection in place,
  199. but it will prevent you from making further fragmented selections.
  200. </para>
  201. </tip>
  202. </sect2>
  203. </sect1>
  204. <sect1 id="entering-text"><title>Inserting and Deleting Text</title>
  205. <para>
  206. Text entered at the keyboard is inserted into the buffer. If
  207. overwrite mode is on, one character is deleted from in
  208. front of the caret position for every character that is inserted.
  209. To activate overwrite mode, press <keycap>Insert</keycap>. The caret is
  210. drawn as horizontal line while in overwrite
  211. mode; the text <literal>ovr</literal> also appears in the status bar.
  212. </para>
  213. <para>
  214. Inserting text while there is a selection will replace the selection
  215. with the inserted text.
  216. </para>
  217. <para>
  218. When inserting text, keep in mind that the <keycap>Tab</keycap> and
  219. <keycap>Enter</keycap> keys might
  220. not behave entirely like you expect because of various indentation
  221. features; see <xref linkend="indent" /> for details.
  222. </para>
  223. <para>
  224. The simplest way to delete text is with the
  225. <keycap>Backspace</keycap> and <keycap>Delete</keycap> keys. If nothing is
  226. selected, they delete the character before or after the caret,
  227. respectively. If a selection exists, both delete the
  228. selection.
  229. </para>
  230. <para>
  231. More advanced deletion commands are described in
  232. <xref linkend="words" />, <xref linkend="lines" /> and
  233. <xref linkend="paragraphs" />.
  234. </para>
  235. </sect1>
  236. <sect1 id="undo-redo"><title>Undo and Redo</title>
  237. <para>
  238. <guimenu>Edit</guimenu>&gt;<guimenuitem>Undo</guimenuitem> (shortcut:
  239. <keycombo><keycap>Control</keycap><keycap>Z</keycap></keycombo>) undoes the
  240. effects of the most recent text editing command. For example, this can be
  241. used to restore unintentionally deleted text. More complicated operations,
  242. such as a search and replace, can also be undone. By default, the undo
  243. queue remembers the last 100 edits; older edits are discarded.
  244. The undo queue size can be changed in the <guibutton>Editing</guibutton> pane
  245. of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global
  246. Options</guimenuitem> dialog box.
  247. </para>
  248. <para>
  249. <guimenu>Edit</guimenu>&gt;<guimenuitem>Redo</guimenuitem> (shortcut:
  250. <keycombo><keycap>Control</keycap><keycap>R</keycap></keycombo>) goes forward
  251. in the undo queue, redoing changes which were undone. For example, if some
  252. text was inserted, <guimenuitem>Undo</guimenuitem> will remove it from the
  253. buffer. <guimenuitem>Redo</guimenuitem> will insert it again.
  254. </para>
  255. </sect1>
  256. <sect1 id="words"><title>Working With Words</title>
  257. <para>
  258. Holding down <keycap>Control</keycap> in addition to <keycap>Left</keycap> or
  259. <keycap>Right</keycap> moves the caret a word at
  260. a time. Holding down <keycap>Shift</keycap> and <keycap>Control</keycap>
  261. in addition to <keycap>Left</keycap> or <keycap>Right</keycap>
  262. extends the selection a word at a time.
  263. </para>
  264. <para>
  265. A single word can be selected by double-clicking with the mouse,
  266. or using the
  267. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Select
  268. Word</guimenuitem> command (shortcut:
  269. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo> <keycap>W</keycap>).
  270. A selection that begins and ends on word boundaries can be created by
  271. double-clicking and dragging.
  272. </para>
  273. <para>
  274. Pressing <keycap>Control</keycap> in addition to
  275. <keycap>Backspace</keycap> or <keycap>Delete</keycap> deletes the word
  276. before or after the caret, respectively.
  277. </para>
  278. <para>
  279. <guimenu>Edit</guimenu>&gt;<guimenuitem>Word Count</guimenuitem>
  280. displays a dialog box with the number of characters,
  281. words and lines in the current buffer.
  282. </para>
  283. <para>
  284. <guimenu>Edit</guimenu>&gt;<guimenuitem>Complete Word</guimenuitem> (shortcut:
  285. <keycombo><keycap>Control</keycap><keycap>B</keycap></keycombo>) locates
  286. possible completions for the word at the caret, first by looking in the
  287. current edit mode's keyword list, and then searching the current buffer.
  288. </para>
  289. <para>
  290. If there is only one completion, it will be inserted into the buffer
  291. immediately.
  292. If multiple completions were found, they will be listed in a popup below
  293. the caret position. To insert a completion from the list, either click it
  294. with the mouse,
  295. or select it using the <keycap>Up</keycap> and <keycap>Down</keycap> keys and
  296. press <keycap>Enter</keycap>. To close the popup without inserting a
  297. completion, press <keycap>Escape</keycap>. Typing while the popup is
  298. visible will automatically update the popup and narrow the set of
  299. completions as necessary.
  300. </para>
  301. <para>
  302. This feature be used to avoid retyping
  303. previously entered identifiers in program source, for example.
  304. </para>
  305. </sect1>
  306. <sect1 id="lines"><title>Working With Lines</title>
  307. <para>
  308. An entire line can be selected by triple-clicking with the mouse,
  309. or using the
  310. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Select
  311. Line</guimenuitem> command (shortcut:
  312. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo> <keycap>L</keycap>).
  313. A selection that begins and ends on line boundaries can be created
  314. by triple-clicking and dragging.
  315. </para>
  316. <para>
  317. <guimenu>Edit</guimenu>&gt;<guimenuitem>Go to Line</guimenuitem> (shortcut:
  318. <keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>) displays an
  319. input dialog box and moves the caret to the specified line number.
  320. </para>
  321. <para>
  322. <guimenu>Edit</guimenu>&gt;<guisubmenu>More
  323. Selection</guisubmenu>&gt;<guimenuitem>Select Line Range</guimenuitem>
  324. (shortcut
  325. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  326. <keycombo><keycap>Control</keycap><keycap>L</keycap></keycombo>)
  327. selects all text between between two specified line numbers, inclusive.
  328. </para>
  329. <para>
  330. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Join
  331. Lines</guimenuitem> (shortcut:
  332. <keycombo><keycap>Control</keycap><keycap>J</keycap></keycombo>)
  333. removes any whitespace from the start of the next line and joins it with
  334. the current line. For example, invoking <guimenuitem>Join Lines</guimenuitem>
  335. on the first line of the following Java code:
  336. </para>
  337. <screen>new Widget(Foo
  338. .createDefaultFoo());</screen>
  339. <para>
  340. Will change it to:
  341. </para>
  342. <screen>new Widget(Foo.createDefaultFoo());</screen>
  343. <para>
  344. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Delete
  345. Line</guimenuitem>
  346. (shortcut: <keycombo><keycap>Control</keycap><keycap>D</keycap></keycombo>)
  347. deletes the current line.
  348. </para>
  349. <para>
  350. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Delete
  351. to Start Of Line</guimenuitem>
  352. (shortcut:
  353. <keycombo><keycap>Control</keycap><keycap>Shift</keycap><keycap>Backspace</keycap></keycombo>)
  354. deletes all text from the start of the current line to the caret.
  355. </para>
  356. <para>
  357. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Delete
  358. to End Of Line</guimenuitem>
  359. (shortcut:
  360. <keycombo><keycap>Control</keycap><keycap>Shift</keycap><keycap>Delete</keycap></keycombo>) deletes
  361. all text from the caret to the end of the current line.
  362. </para>
  363. <para>
  364. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Remove
  365. Trailing Whitespace</guimenuitem>
  366. (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  367. <keycap>R</keycap>) removes all whitespace from the end of each selected line, or
  368. the current line if there is no selection.
  369. </para>
  370. </sect1>
  371. <sect1 id="paragraphs"><title>Working With Paragraphs</title>
  372. <para>
  373. As far as jEdit is concerned, <quote>paragraphs</quote> are delimited by
  374. double newlines. This is also how <application>TeX</application>
  375. defines a paragraph. Note that jEdit doesn't parse HTML files for
  376. <quote>&lt;P&gt;</quote> tags, nor does it support paragraphs delimited only
  377. by a leading indent.
  378. </para>
  379. <para>
  380. Holding down <keycap>Control</keycap> in addition to <keycap>Up</keycap>
  381. or <keycap>Down</keycap>
  382. moves the caret to the previous and next paragraph, respectively.
  383. As with other caret movement commands, holding down <keycap>Shift</keycap>
  384. in addition to the above
  385. extends the selection, a paragraph at a time.
  386. </para>
  387. <para>
  388. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Select
  389. Paragraph</guimenuitem> (shortcut:
  390. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  391. <keycap>P</keycap>)
  392. selects the paragraph containing the caret.
  393. </para>
  394. <para>
  395. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Delete
  396. Paragraph</guimenuitem> (shortcut:
  397. <keycombo><keycap>Control</keycap><keycap>E</keycap>
  398. </keycombo> <keycap>D</keycap>)
  399. deletes the paragraph containing the caret.
  400. </para>
  401. <para>
  402. <guimenu>Edit</guimenu>&gt;<guisubmenu>Text</guisubmenu>&gt;<guimenuitem>Format
  403. Paragraph</guimenuitem> (shortcut:
  404. <keycombo><keycap>Control</keycap><keycap>E</keycap>
  405. </keycombo> <keycap>F</keycap>) splits and joins lines in the current
  406. paragraph to make them fit within the wrap column position. See
  407. <xref linkend="entering-text" /> for information and word wrap and
  408. changing the wrap column.
  409. </para>
  410. </sect1>
  411. <sect1 id="word-wrap"><title>Word Wrap</title>
  412. <para>
  413. The <firstterm>word wrap</firstterm> feature splits lines of text at word
  414. boundaries in
  415. order for the text to fit inside a specified wrap margin.
  416. Two wrap modes are available; "soft" and "hard". These two modes are
  417. described below. The wrap margin
  418. position is indicated in the text are as a faint blue vertical line.
  419. The wrap mode and wrap
  420. column location can be changed in one of several ways:
  421. </para>
  422. <itemizedlist>
  423. <listitem><para>On a global or mode-specific
  424. basis in the
  425. <guibutton>Editing</guibutton> and <guibutton>Mode-Specific</guibutton> panes
  426. of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  427. dialog box; see <xref linkend="global-opts" />.</para></listitem>
  428. <listitem><para>In the current buffer
  429. for the duration of the editing session in the
  430. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Buffer Options</guimenuitem>
  431. dialog box; see <xref linkend="buffer-opts" />.
  432. </para></listitem>
  433. <listitem><para>In the current buffer
  434. for future editing sessions by placing
  435. the following in one of the first or last 10 lines of the buffer, where
  436. <replaceable>mode</replaceable> is either <quote>soft</quote> or
  437. <quote>hard</quote>, and
  438. <replaceable>column</replaceable> is the desired wrap margin position:
  439. </para>
  440. <screen>:wrap=<replaceable>mode</replaceable>:maxLineLen=<replaceable>column</replaceable>:</screen>
  441. </listitem>
  442. </itemizedlist>
  443. <sect2><title>Soft Wrap</title>
  444. <para>
  445. In soft wrap mode, lines are automatically wrapped when being displayed. No
  446. newlines are inserted, and the wrapping is automatically updated when text
  447. is inserted or removed.
  448. If you set the wrap column to zero while soft wrap is enabled, text will be
  449. wrapped to the width of the text area.
  450. </para>
  451. <para>
  452. If end of line markers are enabled in the <guibutton>Text Area</guibutton>
  453. pane of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  454. dialog box, a colon (<quote>:</quote>) is painted at the end of wrapped lines.
  455. </para>
  456. <para>
  457. Note that since jEdit only scrolls one whole <quote>physical</quote>
  458. (newline-delimited) line
  459. at a time, having lines wrapped into more sections than visible in the
  460. text area will render portions of the buffer inaccessable.
  461. </para>
  462. </sect2>
  463. <sect2><title>Hard Wrap</title>
  464. <para>
  465. In hard wrap mode,
  466. inserting text at the end of a line beyond the wrap column will
  467. automatically insert a line break at the appropriate word boundary.
  468. Existing text is not changed in any way.
  469. </para>
  470. <para>
  471. Hard wrap is implemented using character offsets, not screen
  472. positions, so it might not behave like you expect if a
  473. proportional-width font is being used. For information about
  474. changing the font used in the text area, see <xref linkend="global-opts" />.
  475. </para>
  476. </sect2>
  477. </sect1>
  478. <sect1 id="scrolling"><title>Scrolling</title>
  479. <para>
  480. <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Scroll to
  481. Current Line</guimenuitem> (shortcut:
  482. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  483. <keycombo><keycap>Control</keycap><keycap>J</keycap></keycombo>) centers the
  484. line containing the caret on the screen.
  485. </para>
  486. <para>
  487. <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Center Caret
  488. on Screen</guimenuitem> (shortcut:
  489. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  490. <keycombo><keycap>Control</keycap><keycap>I</keycap></keycombo>)
  491. moves the caret to the
  492. line in the middle of the screen.
  493. </para>
  494. <para>
  495. <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Line
  496. Scroll Up</guimenuitem> (shortcut:
  497. <keycombo><keycap>Control</keycap><keycap>'</keycap></keycombo>)
  498. scrolls the text area up by one line.
  499. </para>
  500. <para>
  501. <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Line
  502. Scroll Down</guimenuitem> (shortcut:
  503. <keycombo><keycap>Control</keycap><keycap>/</keycap></keycombo>) scrolls the
  504. text area down by one line.
  505. </para>
  506. <para>
  507. <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Page
  508. Scroll Up</guimenuitem> (shortcut:
  509. <keycombo><keycap>Alt</keycap><keycap>'</keycap></keycombo>) scrolls the text
  510. area up by one screenful.
  511. </para>
  512. <para>
  513. <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Page
  514. Scroll Down</guimenuitem> (shortcut:
  515. <keycombo><keycap>Alt</keycap><keycap>/</keycap></keycombo>) scrolls the text
  516. area down by one screenful.
  517. </para>
  518. <para>
  519. The above scrolling commands differ from the caret movement commands
  520. in that they don't actually move the caret; they just change the
  521. scroll bar position.
  522. </para>
  523. <para>
  524. <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Synchronized
  525. Scrolling</guimenuitem> is a check box menu item, that if selected,
  526. forces scrolling performed in one text area to be propagated to all
  527. other text areas in the current view. Invoking the command a second
  528. time disables the feature.
  529. </para>
  530. </sect1>
  531. <sect1 id="text-transfer"><title>Transferring Text</title>
  532. <para>
  533. jEdit provides a rich set of commands for moving and copying text.
  534. Internally, jEdit stores text in so-called <firstterm>registers</firstterm>.
  535. A register is a holding
  536. area with a single-character name that can hold once piece of text at a time.
  537. Registers are global to the editor; all buffers share the same set.
  538. </para>
  539. <para>
  540. The system clipboard is mapped to a register named <filename>$</filename>.
  541. For convenience, jEdit offers clipboard-manipulation commands similar
  542. to those found in other applications, in addition to a more flexible
  543. set of commands for working with registers directly.
  544. </para>
  545. <sect2><title>The System Clipboard</title>
  546. <para>
  547. <guimenu>Edit</guimenu>&gt;<guimenuitem>Cut</guimenuitem>
  548. (shortcut: <keycombo><keycap>Control</keycap><keycap>X</keycap></keycombo>)
  549. places the selected text in the clipboard and removes it from the buffer.
  550. </para>
  551. <para>
  552. <guimenu>Edit</guimenu>&gt;<guimenuitem>Copy</guimenuitem>
  553. (shortcut: <keycombo><keycap>Control</keycap><keycap>C</keycap></keycombo>)
  554. places the selected text in the clipboard and leaves it in the buffer.
  555. </para>
  556. <para>
  557. <guimenu>Edit</guimenu>&gt;<guimenuitem>Paste</guimenuitem>
  558. (shortcut: <keycombo><keycap>Control</keycap><keycap>V</keycap></keycombo>)
  559. inserts the clipboard contents in place of the selection (or at the
  560. caret position, if there is no selection).
  561. </para>
  562. <para>
  563. The <guimenuitem>Cut</guimenuitem> and <guimenuitem>Copy</guimenuitem>
  564. commands replace the old clipboard contents with the selected text.
  565. There are two alternative commands which add the selection to the existing
  566. clipboard contents, instead of replacing it.
  567. </para>
  568. <para>
  569. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>Cut Append</guimenuitem>
  570. (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  571. <keycombo><keycap>Control</keycap><keycap>U</keycap></keycombo>)
  572. appends the selected text to the clipboard, then removes it from the
  573. buffer. After this command has been invoked, the clipboard will consist of
  574. the former clipboard contents, followed by a newline, followed by the
  575. selected text.
  576. </para>
  577. <para>
  578. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>Copy Append</guimenuitem>
  579. (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  580. <keycombo><keycap>Control</keycap><keycap>A</keycap></keycombo>)
  581. is the same as <guimenuitem>Cut Append</guimenuitem> except it does not
  582. remove the selection from the buffer.
  583. </para>
  584. </sect2>
  585. <sect2><title>Quick Copy</title>
  586. <para>
  587. Quick copy is disabled by default, but it can be enabled in the
  588. <guibutton>Text Area</guibutton> pane of the
  589. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  590. dialog box. When quick copy is enabled:
  591. </para>
  592. <itemizedlist>
  593. <listitem><para>
  594. Clicking the middle mouse button in the text area inserts the most recently
  595. selected text at the clicked location.
  596. If you only have a two-button mouse, you can click the left mouse button
  597. while holding down <keycap>Alt</keycap> instead of middle-clicking.
  598. </para>
  599. <para>
  600. Internally, this is implemented by storing the most recently selected text
  601. in the <filename>%</filename> register (recall that registers have
  602. single-character names).
  603. </para>
  604. <para>
  605. If jEdit is being run under Java 2 version 1.4 on Unix, you will be
  606. able to transfer text with other X Windows applications using the
  607. quick copy feature. On other platforms and Java versions, the contents
  608. of the quick copy register are only accessible from within jEdit.
  609. </para></listitem>
  610. <listitem><para>
  611. Dragging with the middle mouse button
  612. creates a selection without moving the
  613. caret. As soon as the mouse button is released, the selected text is
  614. inserted at the caret position and the selection is deactivated.
  615. A message is shown in the status bar while text is being selected to
  616. remind you that this is not an ordinary selection.
  617. </para></listitem>
  618. </itemizedlist>
  619. </sect2>
  620. <sect2><title>General Register Commands</title>
  621. <para>
  622. These commands are slightly less convenient to use than the two methods of
  623. transferring text described above, but are more powerful.
  624. </para>
  625. <para>
  626. These commands all expect a single-character
  627. register name to be typed at the keyboard after the command is
  628. invoked, and subsequently operate on that register.
  629. Pressing <keycap>Escape</keycap> instead of specifying a register name
  630. will cancel the operation.
  631. </para>
  632. <para>
  633. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>Cut
  634. to Register</guimenuitem>
  635. (shortcut: <keycombo><keycap>Control</keycap><keycap>R</keycap></keycombo>
  636. <keycombo><keycap>Control</keycap><keycap>X</keycap></keycombo>
  637. <keycap><replaceable>key</replaceable></keycap>)
  638. stores the selected text in the specified
  639. register, removing it from the buffer.
  640. </para>
  641. <para>
  642. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>Copy
  643. to Register</guimenuitem>
  644. (shortcut: <keycombo><keycap>Control</keycap><keycap>R</keycap></keycombo>
  645. <keycombo><keycap>Control</keycap><keycap>C</keycap></keycombo>
  646. <keycap><replaceable>key</replaceable></keycap>)
  647. stores the selected text in the specified
  648. register, leaving it in the buffer.
  649. </para>
  650. <para>
  651. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>Cut
  652. Append to Register</guimenuitem>
  653. (shortcut: <keycombo><keycap>Control</keycap><keycap>R</keycap></keycombo>
  654. <keycombo><keycap>Control</keycap><keycap>U</keycap></keycombo>
  655. <keycap><replaceable>key</replaceable></keycap>)
  656. adds the selected text to the existing contents of the specified
  657. register, and removes it from the buffer.
  658. </para>
  659. <para>
  660. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>Copy
  661. Append to Register</guimenuitem>
  662. (shortcut: <keycombo><keycap>Control</keycap><keycap>R</keycap></keycombo>
  663. <keycombo><keycap>Control</keycap><keycap>A</keycap></keycombo>
  664. <keycap><replaceable>key</replaceable></keycap>)
  665. adds the selected text to the existing contents of the specified
  666. register, without removing it from the buffer.
  667. </para>
  668. <para>
  669. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>Paste
  670. from Register</guimenuitem>
  671. (shortcut: <keycombo><keycap>Control</keycap><keycap>R</keycap></keycombo>
  672. <keycombo><keycap>Control</keycap><keycap>V</keycap></keycombo>
  673. <keycap><replaceable>key</replaceable></keycap>)
  674. replaces the selection with the
  675. contents of the specified register.
  676. </para>
  677. <para>
  678. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>Paste Previous</guimenuitem>
  679. (shortcut:
  680. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  681. <keycombo><keycap>Control</keycap><keycap>V</keycap></keycombo>)
  682. displays a dialog box listing recently copied and
  683. pasted text. By default, the last 20 strings are remembered; this can be
  684. changed in the <guibutton>General</guibutton> pane of the
  685. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  686. dialog box; see <xref linkend="global-opts" />.
  687. </para>
  688. <para>
  689. <guimenu>Edit</guimenu>&gt;<guisubmenu>More Clipboard</guisubmenu>&gt;<guimenuitem>View
  690. Registers</guimenuitem> displays a dialog box for
  691. viewing the contents of registers (including the clipboard).
  692. </para>
  693. </sect2>
  694. </sect1>
  695. <sect1 id="markers"><title>Markers</title>
  696. <para>
  697. Each buffer can have any number of <firstterm>markers</firstterm> defined,
  698. pointing to
  699. specific locations within that buffer. Each line in a buffer can have
  700. at most one marker set pointing to it. Markers are persistent; they are
  701. saved to
  702. <filename>.<replaceable>filename</replaceable>.marks</filename>, where
  703. <filename><replaceable>filename</replaceable></filename> is the file
  704. name. (The dot prefix
  705. makes the markers file hidden on Unix systems.) Marker
  706. saving can be
  707. disabled in the <guibutton>Loading and Saving</guibutton> pane of the
  708. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  709. dialog box; see <xref linkend="global-opts" />.
  710. </para>
  711. <para>
  712. Markers are listed in the <guimenu>Markers</guimenu> menu; selecting a marker
  713. from this menu is the simplest way to return to its location.
  714. Each marker can optionally have a single-character shortcut; markers without
  715. a shortcut can only be returned to using the menu, markers with a shortcut
  716. can be accessed more quickly from the keyboard.
  717. </para>
  718. <para>
  719. Lines which contain markers are indicated in the gutter with a highlight.
  720. Moving the mouse over the highlight displays a tool tip showing the marker's
  721. shortcut, if it has one. See <xref linkend="textarea" /> for information
  722. about the gutter.
  723. </para>
  724. <para>
  725. <guimenu>Markers</guimenu>&gt;<guimenuitem>Add/Remove Marker</guimenuitem>
  726. (shortcut:
  727. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  728. <keycombo><keycap>Control</keycap><keycap>M</keycap></keycombo>) adds a
  729. marker without a shortcut pointing to the current line. If a marker is
  730. already set on the current line, the marker is removed instead.
  731. If text is selected,
  732. markers are added to the first and last line of each selection.
  733. </para>
  734. <para>
  735. <guimenu>Markers</guimenu>&gt;<guimenuitem>Add Marker With
  736. Shortcut</guimenuitem>
  737. (shortcut: <keycombo><keycap>Control</keycap><keycap>T</keycap></keycombo>
  738. <keycap><replaceable>key</replaceable></keycap>)
  739. reads the next character entered at the keyboard, and adds a marker with that
  740. shortcut pointing to the current line. If a previously-defined marker already
  741. has that shortcut, it will no longer have that shortcut, but will remain
  742. in the buffer. Pressing <keycap>Escape</keycap> instead of specifying a
  743. marker shortcut after invoking the command will cancel the operation.
  744. </para>
  745. <para>
  746. <guimenu>Markers</guimenu>&gt;<guimenuitem>Go to Marker</guimenuitem>
  747. (shortcut: <keycombo><keycap>Control</keycap><keycap>Y</keycap></keycombo>
  748. <keycap><replaceable>key</replaceable></keycap>)
  749. reads the next character entered at the keyboard, and moves the caret to the
  750. location of the marker with that shortcut. Pressing <keycap>Escape</keycap>
  751. instead of specifying a marker
  752. shortcut after invoking the command will cancel the operation.
  753. </para>
  754. <para>
  755. <guimenu>Markers</guimenu>&gt;<guimenuitem>Select to Marker</guimenuitem>
  756. (shortcut: <keycombo><keycap>Control</keycap><keycap>U</keycap></keycombo>
  757. <keycap><replaceable>key</replaceable></keycap>)
  758. reads the next character entered at the keyboard, and extends
  759. the selection to the location of the marker with that shortcut.
  760. Pressing <keycap>Escape</keycap> instead of specifying a marker
  761. shortcut after invoking the command will cancel the operation.
  762. </para>
  763. <para>
  764. <guimenu>Markers</guimenu>&gt;<guimenuitem>Swap Caret and
  765. Marker</guimenuitem> (shortcut:
  766. <keycombo><keycap>Control</keycap><keycap>U</keycap></keycombo>
  767. <keycap><replaceable>key</replaceable></keycap>)
  768. reads the next character entered at the keyboard, and swaps the
  769. position of the caret with the location of the marker with that shortcut.
  770. Pressing <keycap>Escape</keycap> instead of specifying a marker
  771. shortcut after invoking the command will cancel the operation.
  772. </para>
  773. <para>
  774. <guimenu>Markers</guimenu>&gt;<guimenuitem>Go to Previous
  775. Marker</guimenuitem>
  776. (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  777. <keycombo><keycap>Control</keycap><keycap>,</keycap></keycombo>) goes
  778. to the marker immediately before the caret position.
  779. </para>
  780. <para>
  781. <guimenu>Markers</guimenu>&gt;<guimenuitem>Go to Next Marker</guimenuitem>
  782. (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  783. <keycombo><keycap>Control</keycap><keycap>.</keycap></keycombo>)
  784. goes to the marker immediately after the caret position.
  785. </para>
  786. <para>
  787. <guimenu>Markers</guimenu>&gt;<guimenuitem>Remove All Markers</guimenuitem>
  788. removes all markers set in the current buffer.
  789. </para>
  790. </sect1>
  791. <sect1 id="search-replace"><title>Search and Replace</title>
  792. <sect2><title>Searching For Text</title>
  793. <para>
  794. <guimenu>Search</guimenu>&gt;<guimenuitem>Find</guimenuitem> (shortcut:
  795. <keycombo><keycap>Control</keycap><keycap>F</keycap></keycombo>) displays
  796. the search and replace dialog box.
  797. </para>
  798. <para>
  799. The search string can be entered in the <guibutton>Search for</guibutton>
  800. text field. This text field remembers previously entered strings; see
  801. <xref linkend="history" /> for details.
  802. </para>
  803. <para>
  804. If text was selected in the text area and the selection
  805. does not span a line break, the selected text becomes the default search
  806. string.
  807. </para>
  808. <para>
  809. If the selection consists of multiple lines, the
  810. <guibutton>Search in Selection</guibutton>
  811. and <guibutton>HyperSearch</guibutton>
  812. buttons will be pre-selected, and the search string field will be blank.
  813. <!-- Note that finding the next or previous
  814. occurrence cannot be constrained to a selected range; only
  815. replacement and HyperSearch can be (see <xref linkend="hypersearch" />). -->
  816. </para>
  817. <para>
  818. The search can be made case insensitive (for example, searching for
  819. <quote>Hello</quote> will match <quote>hello</quote>, <quote>HELLO</quote>
  820. and <quote>HeLlO</quote>) by selecting the <guibutton>Ignore
  821. case</guibutton> check box.
  822. </para>
  823. <para>
  824. If the <guibutton>Regular expressions</guibutton> check
  825. box is selected, regular expressions may be used to match inexact
  826. sequences of text that can optionally span more than one line.
  827. Regular expression syntax is described in detail in
  828. <xref linkend="regexps" />.
  829. </para>
  830. <para>
  831. Note that regular expressions can only be used when
  832. searching in a forward direction.
  833. </para>
  834. <para>
  835. Clicking <guibutton>Find</guibutton> will locate the next (or previous, if
  836. searching backwards) occurrence of the
  837. search string after the caret position. If the
  838. <guibutton>Keep dialog</guibutton> check box is selected, the dialog box
  839. will remain open; otherwise, it will be closed after the search string is
  840. located.
  841. </para>
  842. <para>
  843. If no occurrences could be found and the
  844. <guibutton>Auto wrap</guibutton> check box is selected, the search will
  845. automatically be restarted and a message will be shown in the status bar
  846. to indicate that. If the check box is not selected, a dialog
  847. box will be displayed, offering to restart the search.
  848. </para>
  849. <para>
  850. <guimenu>Search</guimenu>&gt;<guimenuitem>Find Next</guimenuitem> (shortcut:
  851. <keycombo><keycap>Control</keycap><keycap>G</keycap></keycombo>) locates the
  852. next occurrence of the most recent search string without displaying the
  853. search and replace dialog box.
  854. </para>
  855. <para>
  856. <guimenu>Search</guimenu>&gt;<guimenuitem>Find Previous</guimenuitem>
  857. (shortcut: <keycombo><keycap>Control</keycap><keycap>H</keycap></keycombo>)
  858. locates the previous occurrence of the most recent search string without
  859. displaying the search and replace dialog box.
  860. </para>
  861. </sect2>
  862. <sect2><title>Replacing Text</title>
  863. <para>
  864. The replace string text field remembers previously entered strings;
  865. see <xref linkend="history" /> for details.
  866. </para>
  867. <para>
  868. Clicking <guibutton>Replace &amp; Find</guibutton> will perform a
  869. replacement in the current selection and locate the next occurrence of the
  870. search string. Clicking <guibutton>Replace All</guibutton> will replace all
  871. occurrences of the search string with the replacement string in the current
  872. search scope (which is either the selection, the current buffer, or a set of
  873. buffers, as specified in the search and replace dialog box).
  874. </para>
  875. <para>
  876. Occurrences of the search string can be replaced with either a replacement
  877. string, or the result of a BeanShell script snippet. Two radio buttons in
  878. the search and replace dialog box can be used to choose between these
  879. behaviors, which are described below in more detail.
  880. </para>
  881. <sect3><title>Text Replace</title>
  882. <para>
  883. If the <guibutton>Text</guibutton> radio button is selected,
  884. the search string is replaced with the replacement
  885. string.
  886. </para>
  887. <para>
  888. If regular expressions are enabled, positional parameters
  889. (<literal>$0</literal>, <literal>$1</literal>, <literal>$2</literal>, and so
  890. on) can be used to insert the contents of matched subexpressions in the
  891. replacement string; see <xref linkend="regexps" /> for more information.
  892. </para>
  893. <para>
  894. If the search is case-insensitive, jEdit attempts to modify the
  895. case of the replacement string to match that of the particular instance
  896. of the search string being replaced. For example, if you are searching
  897. for <quote>label</quote> and replacing it with <quote>text</quote>, then
  898. the following replacements could be made:
  899. </para>
  900. <itemizedlist>
  901. <listitem><para><quote>String label</quote> would become <quote>String text</quote>
  902. </para></listitem>
  903. <listitem><para><quote>setLabel</quote> would become <quote>setText</quote>
  904. </para></listitem>
  905. <listitem><para><quote>DEFAULT_LABEL</quote> would become <quote>DEFAULT_TEXT</quote>
  906. </para></listitem>
  907. </itemizedlist>
  908. </sect3>
  909. <sect3><title>BeanShell Replace</title>
  910. <para>
  911. In BeanShell replacement mode, the search string is replaced with the return
  912. value of a BeanShell snippet. The following predefined variables can be
  913. referenced in the snippet:
  914. </para>
  915. <itemizedlist><listitem><para><varname>_0</varname> -- the text to be
  916. replaced</para>
  917. </listitem><listitem><para><varname>_1</varname> - <varname>_9</varname> --
  918. if regular expressions are enabled, these contain the values of matched
  919. subexpressions.
  920. </para></listitem></itemizedlist>
  921. <para>
  922. BeanShell syntax and features are covered in great detail in
  923. <xref linkend="writing-macros-part" />, but here are some examples:
  924. </para>
  925. <informalexample>
  926. <para>
  927. To convert all HTML tags to lower case, search
  928. for the following regular expression:
  929. </para>
  930. <programlisting><![CDATA[<(.*?)>]]></programlisting>
  931. <para>
  932. Replacing it with the following BeanShell snippet:
  933. </para>
  934. <programlisting><![CDATA["<" + _1.toLowerCase() + ">"]]></programlisting>
  935. </informalexample>
  936. <informalexample>
  937. <para>
  938. To replace arithmetic expressions between curly braces with their result,
  939. search for the following regular expression:
  940. </para>
  941. <programlisting><![CDATA[\{(.+?)\}]]></programlisting>
  942. <para>
  943. Replacing it with the following BeanShell snippet:
  944. </para>
  945. <programlisting><![CDATA[eval(_1)]]></programlisting>
  946. </informalexample>
  947. <para>
  948. These two examples only scratch the surface; the possibilities are endless.
  949. </para>
  950. </sect3>
  951. </sect2>
  952. <sect2 id="hypersearch"><title>HyperSearch</title>
  953. <para>
  954. If the <guibutton>HyperSearch</guibutton> check box in the search and
  955. replace dialog box is selected, clicking <guibutton>Find</guibutton> will
  956. list all occurrences of the search string in the current search scope,
  957. instead of locating them one by one as an ordinary search would.
  958. </para>
  959. <para>
  960. By default, HyperSearch results are shown in a floating window;
  961. the window can be set to dock into the view
  962. in the <guibutton>Docking</guibutton> pane of the
  963. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  964. dialog box; see <xref linkend="docking" />.
  965. </para>
  966. <para>
  967. Running searches can be stopped in the
  968. <guimenu>Utilities</guimenu>&gt;<guisubmenu>Troubleshooting</guisubmenu>&gt;<guimenuitem>I/O Progress
  969. Monitor</guimenuitem> dialog box.
  970. </para>
  971. </sect2>
  972. <sect2><title>Multiple File Search</title>
  973. <para>
  974. Search and replace commands can be performed in more than
  975. one file at a time.
  976. </para>
  977. <para>
  978. If the <guibutton>All buffers</guibutton> radio button in the search and
  979. replace dialog box is selected, all open buffers whose names match the glob
  980. pattern
  981. entered in the <guibutton>Filter</guibutton> text field will be searched.
  982. See <xref linkend="globs" /> for more information about glob patterns.
  983. </para>
  984. <para>
  985. If the <guibutton>Directory</guibutton> radio button is selected, all files
  986. in the directory whose names match the glob will be searched. The
  987. directory to search in can either be entered in the
  988. <guibutton>Directory</guibutton> text field, or chosen in a file selector
  989. dialog box by clicking <guibutton>Choose</guibutton>.
  990. If the <guibutton>Search subdirectories</guibutton> check box is selected,
  991. all subdirectories of the specified directory will also be searched. Keep
  992. in mind that searching through directories with many files can take
  993. a long time and consume a large amount of memory.
  994. </para>
  995. <para>
  996. The <guibutton>Directory</guibutton> and <guibutton>Filter</guibutton>
  997. text fields remember previously entered strings; see <xref linkend="history" />
  998. for details.
  999. </para>
  1000. <!-- <para>
  1001. Note that clicking the <guibutton>All Buffers</guibutton> or
  1002. <guibutton>Directory</guibutton> radio buttons also selects the
  1003. <guibutton>HyperSearch</guibutton> check box. This is merely for
  1004. convenience, however; normal searching is supported for multiple files as well.
  1005. </para> -->
  1006. <para>
  1007. Two convenience commands are provided for performing multiple file searches.
  1008. </para>
  1009. <para>
  1010. <guimenu>Search</guimenu>&gt;<guimenuitem>Search in Open
  1011. Buffers</guimenuitem> (shortcut:
  1012. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  1013. <keycombo><keycap>Control</keycap><keycap>B</keycap></keycombo>) displays
  1014. the search and replace dialog box, and selects the <guibutton>All
  1015. buffers</guibutton> radio button.
  1016. </para>
  1017. <para>
  1018. <guimenu>Search</guimenu>&gt;<guimenuitem>Search in Directory</guimenuitem>
  1019. (shortcut:
  1020. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  1021. <keycombo><keycap>Control</keycap><keycap>D</keycap></keycombo>) displays
  1022. the search and replace dialog box, and selects the
  1023. <guibutton>Directory</guibutton> radio button.
  1024. </para>
  1025. </sect2>
  1026. <sect2><title>The Search Bar</title>
  1027. <para>
  1028. The search bar feature provides a convenient way to
  1029. perform simple searches without
  1030. opening the search and replace dialog box first. Neither multiple file
  1031. search nor replacement can be done from the search bar.
  1032. The search bar remembers
  1033. previously entered strings; see <xref linkend="history" /> for details.
  1034. </para>
  1035. <para>
  1036. By default, the search bar remains hidden until one of the quick search
  1037. commands (described below) is invoked; however you can choose to have it
  1038. always visible in the <guibutton>General</guibutton> pane of the
  1039. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  1040. dialog box.
  1041. </para>
  1042. <para>
  1043. <guimenu>Search</guimenu>&gt;<guimenuitem>Incremental Search</guimenuitem>
  1044. (shortcut: <keycombo><keycap>Control</keycap><keycap>,</keycap></keycombo>)
  1045. moves keyboard focus to the search bar. If text is selected when this
  1046. command is invoked, the selection is inserted into the search bar
  1047. automatically.
  1048. </para>
  1049. <para>
  1050. <guimenu>Search</guimenu>&gt;<guimenuitem>Quick HyperSearch</guimenuitem>
  1051. (shortcut: <keycombo><keycap>Control</keycap><keycap>.</keycap></keycombo>)
  1052. moves keyboard focus to the search bar and pre-selects the
  1053. <guibutton>HyperSearch</guibutton> check box. If text is selected when this
  1054. command is invoked, a HyperSearch for that text is performed immediately.
  1055. </para>
  1056. <para>
  1057. The
  1058. <guimenu>Search</guimenu>&gt;<guimenuitem>Incremental Search
  1059. for Word</guimenuitem>
  1060. (shortcut: <keycombo><keycap>Alt</keycap><keycap>,</keycap></keycombo>)
  1061. and <guimenu>Search</guimenu>&gt;<guimenuitem>Quick HyperSearch
  1062. for Word</guimenuitem>
  1063. (shortcut: <keycombo><keycap>Alt</keycap><keycap>.</keycap></keycombo>)
  1064. commands perform an incremental search and HyperSearch, respectively,
  1065. for the word under the caret.
  1066. </para>
  1067. <para>
  1068. Unless the <guibutton>HyperSearch</guibutton> check box is selected, the
  1069. search bar will perform an <firstterm>incremental search</firstterm>.
  1070. In incremental search mode, the first occurrence of the search
  1071. string is located in the current buffer as it is being typed.
  1072. Pressing <keycap>Enter</keycap>
  1073. and <keycombo><keycap>Shift</keycap><keycap>Enter</keycap></keycombo>
  1074. searches for the next and previous occurrence, respectively.
  1075. Once the desired occurrence has been found, press <keycap>Escape</keycap>
  1076. to return keyboard focus to the text area.
  1077. </para>
  1078. <para>
  1079. On the other hand, if the <guibutton>HyperSearch</guibutton> check box is
  1080. selected, entering a
  1081. search string and pressing <keycap>Enter</keycap> will perform a
  1082. HyperSearch in the current buffer.
  1083. </para>
  1084. <note>
  1085. <para>
  1086. Incremental searches cannot be not recorded in macros. Use the
  1087. search and replace dialog box instead. See <xref linkend="using-macros" />
  1088. for information about macros.
  1089. </para>
  1090. </note>
  1091. </sect2>
  1092. </sect1>
  1093. <sect1 id="repeat"><title>Command Repetition</title>
  1094. <para>
  1095. The final feature discussed in this chapter is a means of invoking a command
  1096. any number of times automatically.
  1097. </para>
  1098. <para>
  1099. To execute a command several times, press
  1100. <keycombo><keycap>Control</keycap><keycap>Enter</keycap></keycombo>, enter the
  1101. desired repeat count, then the command to repeat (either by pressing its
  1102. keyboard shortcut, or selecting or from a menu). For example,
  1103. <q

Large files files are truncated, but you can click here to view the full file