PageRenderTime 72ms CodeModel.GetById 43ms app.highlight 17ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
XML | 1118 lines | 1106 code | 1 blank | 11 comment | 0 complexity | f49d3da87069b8e5e48ad01179084bf3 MD5 | raw file

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

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

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