/jEdit/branches/4.3.x-fix-view-leak/doc/users-guide/text-edit.xml

# · XML · 1246 lines · 1009 code · 233 blank · 4 comment · 0 complexity · 3c7384be06667eb4d7423221850ca558 MD5 · raw file

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