PageRenderTime 88ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/42docs/users-guide/text-edit.xml

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