<othercredit role="translator"><firstname>Malcolm</firstname><surname>Hunter</surname><affiliation><address><email>malcolm.hunter@gmx.co.uk</email></address></affiliation><contrib>Conversion to British English</contrib></othercredit>
<para>The &kate; editor is the editing area of the &kate; window. This editor is also used by &kwrite;, and it can be used in &konqueror; for displaying text files from your local computer, or from the network.</para>
<para>The scroll bars indicate the position of the visible part of the document text, and can be used to move around the document. Dragging the scrollbars will not cause the insertion cursor to be moved.</para>
<para>The scroll bars are displayed and hidden as required.</para>
<para>The icon border is a small pane on the left side of the editor, displaying a small icon next to marked lines.</para>
<para>You can set or remove a <link linkend="kate-part-bookmarks">bookmark</link> in a visible line by clicking the &LMB; in the icon border next to that line.</para>
<para>The display of the icon border can be toggled using the <menuchoice><guimenu>View</guimenu> <guimenuitem>Show Icon Border</guimenuitem></menuchoice> menu item.</para>
<para>The Line numbers pane shows the line numbers of all visible lines in the document.</para>
<para>The display of the Line Numbers Pane can be toggled using the <menuchoice><guimenu>View</guimenu> <guimenuitem>Show Line Numbers</guimenuitem></menuchoice> menu item.</para>
<para>To select using the mouse, hold down the &LMB; while dragging the mouse cursor from where the selection should start, to the desired end point. The text gets selected as you drag.</para>
<para>When selecting text by dragging the mouse, the selected text is copied to the clipboard, and can be pasted by clicking the middle mouse button in the editor, or in any other application to which you want to paste the text. </para>
<para>To select using the keyboard, hold down the &Shift; key while using the navigation keys (The Arrow keys, <keycap>Page Up</keycap>, <keycap>Page Down</keycap>, <keycap>Home</keycap> and <keycap>End</keycap>, possibly in combination with &Ctrl; to extend the move of the text cursor).</para>
<para>See also the section <link linkend="kate-part-navigation">Navigating in the Text</link> in this Chapter.</para>
<para>To <action>Copy</action> the current selection, use the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Copy</guimenuitem></menuchoice> menu item or the keyboard shortcut (defaults to <keycombo action="simul">&Ctrl;<keycap>C</keycap></keycombo>).</para>
<para>To <action>Deselect</action> the current selection, use the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Deselect</guimenuitem></menuchoice> menu item, or the keyboard shortcut (default is <keycombo action="simul">&Ctrl;&Shift;<keycap>A</keycap></keycombo>), or click with the &LMB; in the editor.</para>
<para>When Block Selection is enabled, you can make <quote>vertical selections</quote> in the text, meaning selecting limited columns from multiple lines. This is handy for working with tab separated lines for example.</para>
<para>Block Selection can be toggled using the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Toggle Block Selection</guimenuitem></menuchoice> menu item. The default keyboard shortcut is <keycap>F4</keycap></para>
<para>If Overwrite Selection is enabled, typing or pasting text into the selection will cause the selected text to be replaced. If not enabled, new text will be added at the position of the text cursor.</para>
<para>To change the setting for this option, use the <link linkend="config-dialog-editor-select">Select Page</link> of the <link linkend="config-dialog">Configuration Dialogue</link>.</para>
<para>When Persistent selection is enabled, typing characters or moving the cursor will not cause the Selection to become deselected. This means that you can move the cursor away from the selection and type text.</para>
<para>Persistent Selection can be enabled in the <link linkend="config-dialog-editor-select">Select Page</link> of the <link linkend="config-dialog">Configuration Dialogue</link>.</para>
<para>If Persistent Selection and Overwrite Selection are both enabled, typing or pasting text when the text cursor is inside the selection will cause it to be replaced and deselected.</para>
<para>To copy text, select it and use the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Copy</guimenuitem></menuchoice> menu item. Additionally, selecting text with the mouse will cause selected text to be copied to the clipboard.</para>
<para>To paste the text currently in the clipboard, use the <menuchoice> <guimenu>Edit</guimenu><guimenuitem>Paste</guimenuitem></menuchoice> menu item.</para>
<para>Additionally, text selected with the mouse may be pasted by clicking the <mousebutton>middle</mousebutton> mouse button at the desired position.</para>
<para>If you are using the &kde; desktop, you can retrieve earlier copied text from any application using the &klipper; icon in the &kicker; icon tray.</para>
<para>The Find and Replace Text dialogues in &kate; are very much the same, except the Replace Text dialogue offers the means of entering a replacement string along with a few extra options.</para>
<listitem><para>This is where to enter the search string. The interpretation of the string depends on some of the options described below.</para></listitem>
<para>If checked, the search string is interpreted as a regular expression. A button for using a graphical tool to create or edit the expression will be enabled.</para>
<para>See <link linkend="regular-expressions">Regular Expressions</link> for more on these.</para>
<para>If checked, the search will only match if there is a word boundary at both ends of the string matching, meaning not an alphanumeric character - either some other visible character or a line end.</para>
<para>If checked, the search will look for the first match above the starting point, either cursor position or the beginning of the document, if the <guilabel>From Beginning</guilabel> option is enabled.</para>
<para>This option is disabled if no text is selected, or if the <guilabel>Prompt on Replace</guilabel> option is enabled. If checked, all matches of the search string within the selected text will be replaced with the replace string.</para>
<term><guilabel>Prompt on Replace</guilabel></term>
<listitem><para>If checked, a small dialogue will prompt you for what to do for each time a match is found. It offers the following options: <variablelist>
<para>There is currently no way to use minimal matching when searching for a regular expression. This will be added in a future version of &kate;</para>
<para>To find text, launch the <guilabel>Find Text</guilabel> Dialogue with <keycombo action="simul">&Ctrl;<keycap>F</keycap></keycombo>or from the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Find...</guimenuitem></menuchoice> menu item,enter a search string, set the <link linkend="find-replace-dialog">options</link> as desired and hit <guibutton>Ok</guibutton>. If no matches is found between the starting point for the search (either the text cursor position or the beginning of the document) you will be prompted for permission to continue from the start (or end, if you are searching backwards) of the document.</para>
<para>If a match is found it is selected and the <guilabel>Find Text</guilabel> Dialogue is hidden, but stay tuned, finding further matches is very easy:</para>
<para>To find the next match in the search direction, use the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Find Next</guimenuitem></menuchoice> command or press <keycap>F3</keycap>.</para>
<para>To find the next match in the opposite direction, use the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Find Previous</guimenuitem></menuchoice> command or press <keycombo action="simul">&Shift;<keycap>F3</keycap></keycombo>.</para>
<para>If no match is found before reaching the document border, you will be prompted for permission to cross that.</para>
<para>To replace text, launch the <guilabel>Replace text</guilabel> Dialogue using the <menuchoice><guimenu>Edit</guimenu> <guimenuitem>Replace</guimenuitem></menuchoice> command, or the <keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo> shortcut, enter a search string and optionally a replace string (if the replace string is empty, each match will be replaced with ""), set the <link linkend="find-replace-dialog">options</link> as desired and hit the <guibutton>Ok</guibutton> button.</para>
<para>If you are using a regular expression to find the text to replace, you can employ backreferences to reuse text captured in parenthesised subpatterns of the expression.</para>
<para>See <xref linkend="regular-expressions"/> for more on these.</para>
<para>Moving the insertion cursor to that line, and activate the <menuchoice><guimenu>Bookmarks</guimenu><guimenuitem>Toggle Bookmark</guimenuitem></menuchoice> (<keycombo action="simul">&Ctrl;<keycap>B</keycap></keycombo>) command.</para>
<para>Bookmarks are available in the <guimenu>Bookmarks</guimenu> menu. The individual bookmarks are available as menu items, labelled with the line number of the line with the bookmark, and the first few characters of the text in the line. To move the insertion cursor to the beginning of a bookmarked line, open the menu and select the bookmark.</para>
<para>If the <link linkend="config-dialog-general-reopen-files">Reopen Files</link> option in the <link linkend="config-dialog">Config Dialogue</link> is enabled (or if &kate; was started by the session manager), your bookmarks will be restored when the document is reopened.</para>
<para>This feature allows you to have the text formatted in a very simple way: the text will be wrapped, so that no lines exceed a maximum number of characters per line, unless there is a longer string of non-whitespace characters.</para>
<para>To enable/disable it, check/uncheck the <guibutton>Word Wrap</guibutton> checkbox in the <link linkend="config-dialog-editor-edit">edit page</link> of the <link linkend="config-dialog">configuration dialogue</link>.</para>
<para>To set the maximum line width (maximum characters per line), use the <link linkend="config-dialog-editor-edit-wrap-words-at"><guibutton>Wrap Words At</guibutton></link> option in the <link linkend="config-dialog-editor-edit">edit page</link> of the <link linkend="config-dialog">configuration dialogue</link>.</para>
<para>If enabled, it has the following effects: <itemizedlist>
<listitem><para>While typing, the editor will automatically insert a hard line break after the last whitespace character at a position before the maximum line width is reached.</para></listitem>
<listitem><para>While loading a document, the editor will wrap the text in a similar way, so that no lines are longer than the maximum line width, if they contain any whitespace allowing that.</para></listitem>
<note><para>There is currently no way to set word wrap for document types, or even to enable or disable the feature on document level. This will be fixed in a future version of &kate;</para></note>