<othercredit role="translator"><firstname>John</firstname><surname>Knight</surname><affiliation><address><email>anarchist_tomato@herzeleid.net</email></address></affiliation><contrib>Conversion to British English</contrib></othercredit>
<para>&kwrite; is more than a text editor for the &kde; Desktop. It is meant to be a programmer's editor, and could be considered as at least a partial alternative to more powerful editors. It may be best used in conjunction with &konqueror; for source file browsing for different languages. &kwrite; also works very well as a simple text editor. One of &kwrite;'s main features is the colourised syntax, customised for many different programming languages such as: C/C++, &Java;, Python, Perl, Bash, Modula 2, <acronym>HTML</acronym>, and Ada. </para>
<para>&kwrite; uses the &kde; Drag and Drop protocol. Files may be dragged and dropped onto &kwrite; from the Desktop, &konqueror; or some remote &FTP; site opened in one of &konqueror;'s windows. </para>
<para>Though &kwrite; may most often be started from the KDE program menu, or a desktop icon, it can also be opened at the command line prompt of a terminal window. There are a few useful options that are available when doing this. </para>
<sect2 id="specify-a-file">
<title>Specify a File</title>
<para>By specifying the path and name of a particular file the user can have &kwrite; open (or create) that file immediately upon startup. This option might look something like the following:</para>
<para>The above-mentioned method could even be used to open files on the internet (if the user has an active connection at the time.) An example of this might look like the following:</para>
<listitem><para>Lists version information for &Qt;, &kde;, and &kwrite;. Also available through <userinput><command>kwrite</command> <option>-V</option></userinput> </para></listitem>
<para>Many of the key bindings (shortcuts) are configurable by way of the <link linkend="settings">Settings</link> menu. By default &kwrite; honours the following key bindings.</para>
<entry><para>Toggle between Insert and Overwrite mode. When in insert mode the editor will add any typed characters to the text while pushing along any data to the right of the text cursor. Overwrite mode causes the entry of each character to eliminate the character immediately to the right of the text cursor.</para></entry>
<para>Displays a standard &kde; <guilabel>Open File</guilabel> dialogue. Use the file view to select the file you want to open, and click on <guibutton>Open</guibutton> to open it. You can find more information about the &kde; <guilabel>Open File</guilabel> dialogue in the &kde; User Guide.</para>
<para>This is a shortcut to open recently saved documents. Clicking on this item opens a list to the side of the menu with several of the most recently saved files. Clicking on a specific file will open it in &kwrite; - if the file still resides at the same location. </para>
<para>This saves the current document. If there has already been a save of the document then this will overwrite the previously saved file without asking for the user's consent. If it is the first save of a new document the save as dialogue (described below) will be invoked. </para>
<para>This allows a document to be saved with a new file name. This is done by means of the file dialogue box described above in the <link linkend="open">Open</link> section of this help file. </para>
<para>This will close the editor window, if you have more than one instance of &kwrite; running, through the <guimenuitem>New View</guimenuitem> or <guimenuitem>New Window</guimenuitem> menu items, those instances will not be closed. </para>
<para>This command deletes the current selection and places it on the clipboard. The clipboard is a feature of KDE that works invisibly to provide a way to transfer data between applications.</para>
<para>This copies the currently selected text to the clipboard so that it may be pasted elsewhere. The clipboard is a feature of KDE that works invisibly to provide a way to transfer data between applications.</para>
<para>This will insert the contents of the clipboard at the cursor position. The clipboard is feature of KDE that works invisibly to provide a way to transfer data between applications.</para>
<menuchoice><shortcut> <keycombo action="simul">&Ctrl;<keycap>G</keycap></keycombo> </shortcut> <guimenu>Edit</guimenu> <guimenuitem>Go to line</guimenuitem></menuchoice></term>
<listitem>
<para>This opens the goto line dialogue box which is used to have the cursor jump to a particular line (specified by number) in the document. The line number may be entered directly into the text box or graphically by clicking on the up or down arrow spin controls at the side of the text box. The little up arrow will increase the line number and the down arrow decrease it. There is also a slide control to the right of the text box which allows the user to move the goto point in the document in an analogue manner. </para>
<para>This opens the find dialogue which is used to specify the <guilabel>Text to Find</guilabel> in the document. There is small text box for entering the search pattern which also doubles as a dropdown box. Clicking on the dropdown arrow at the side of the box makes available other recent search patterns. Other parameters are included to make the search more efficient. Selecting <guilabel>Case Sensitive</guilabel> will limit finds to entries that match the case (upper or lower) of each of the characters in the search pattern. <guilabel>Find Backwards</guilabel> directs the search to proceed in an upwardly direction. The <guilabel>Selected Text</guilabel> option keeps the search within currently selected text. Checking <guilabel>Whole Words Only</guilabel> prevents the search from stopping on words that contain the searched for pattern. The <guilabel>Search from Cursor</guilabel> option begins the search from the current position of the cursor within the document rather than from the beginning.</para>
<para>This repeats the last find operation, if any, without calling the find dialogue box, and searching backwards instead of forwards through the document. </para>
<para>This command opens the replace dialogue box. The replace dialogue is almost identical to the above-mentioned find dialogue. In addition to the features in the find dialogue it contains a <guilabel>Replace With:</guilabel> text entry/dropdown box. Using this dialogue the user can specify both the text to be found and text with which to replace it. The additional <guilabel>Prompt On Replace</guilabel> option allows the user to have &kwrite; ask for confirmation before each replacement.</para> </listitem>
<menuchoice><guimenu>Bookmarks</guimenu> <guimenuitem>Clear All Bookmarks</guimenuitem> </menuchoice>
</term>
<listitem>
<para>This command will remove all the markers from the document as well as the list of markers which is appended at the bottom of this menu item. </para>
<listitem><para><action>This initiates the spell checking program - a program designed to help the user catch and correct any spelling errors.</action> Clicking on this entry will start the checker and bring up the speller dialogue box through which the user can control the process. There are four settings lined up vertically in the centre of the dialogue with their corresponding labels just to the left. Starting at the top they are:</para>
<listitem><para>Here, the spell checker indicates the word currently under consideration. This happens when the checker encounters a word not in its dictionary - a file containing a list of correctly spelled words against which it compares each word in the editor.</para></listitem>
<listitem><para>If the checker has any similar words in its dictionary the first one will be listed here. The user can accept the suggestion, type in his or her own correction, or choose a different suggestion from the next box.</para></listitem>
<listitem><para>The checker may list here a number of possible replacements for the word under consideration. Clicking on any one of the suggestions will cause that word to be entered in the <guilabel>Replacement:</guilabel> box, above.</para></listitem>
<term><guibutton>Add to Dictionary</guibutton></term>
<listitem><para>Pressing this button adds the word in the <guilabel>Misspelled Word:</guilabel> box to the checker's dictionary. This means that in the future the checker will always consider this word to be correctly spelled.</para></listitem>
<listitem><para>This button has the checker replace the word under consideration in the document with the word in the <guilabel>Replacement:</guilabel> box.</para></listitem>
<listitem><para>This button causes the checker to replace not only the current <guilabel>Unknown word:</guilabel> but to automatically make the same substitution for any other occurrences of this <guilabel>Misspelled Word:</guilabel> in the document.</para></listitem>
<listitem><para>This button tells the checker to do nothing with the current <guilabel>Unknown word:</guilabel> and to pass over any other instances of the same word.</para> <note><para>This only applies to the current spell check run. If the checker is run again later it will stop on this same word.</para></note></listitem>
<para>This increases the paragraph's indentation by one step. The size of the step depends on the <link linkend="pref-indent"> indentation settings</link>.</para>
<para>This reduces the paragraph's indentation by one step. The size of the step depends on the <link linkend="pref-indent"> indentation settings</link>.</para>
<listitem><para>This removes one space (if any exist) from the beginning of the line where the text cursor is located or from the beginning of any selected lines.</para></listitem>
<para>When checked, this displays a moveable toolbar containing buttons used to initiate frequently used commands. When unchecked the toolbar is hidden. </para>
<para>When checked, this displays a small bar at the bottom of the editor containing information about the status of the current document. When unchecked the statusbar is hidden.</para>
<para>When selected, this displays in the title bar the path (its location in the file system) of the current document. When unchecked the path is hidden.</para>
<para>This command opens a dialogue box whereby the <link linkend="keybindings">key bindings</link> may be changed. A display window at the top of the dialogue box shows the list of commands (actions) that can have keyboard shortcuts. Below the display are three radio buttons. The user may choose between No Key, Default Key, and Custom Key. (Note that a set of radio buttons only allows the selection of one of the offered items - in the way that buttons on a car radio only offer the selection of one preset station. Also, the Default Key selection is only available for those commands that actually have a 'default' shortcut.) Selecting the Custom Key option activates the three check boxes and key button at the bottom of the dialogue. The user may then select a key combination for the command in question by means of the check boxes and key button. For example, with the About KDE command selected in the display window, the user could select &Ctrl; and <keycap>Alt</keycap>, click on the key button, and then press the <keycap>K</keycap> key on the keyboard. This would mean that anytime he or she held down the &Ctrl; and <keycap>Alt</keycap> buttons and pressed <keycap>K</keycap> (while using &kwrite;) the About KDE display box would be called. </para>
<listitem><para>This will open the dialogue whereby the toolbar configuration may be changed. The user can choose which shortcut buttons should appear on the toolbar. A display window on the left lists the commands available to placed on the toolbar. A display on the right lists those commands already on the toolbar. A set of four arrow buttons between the two displays manipulates the selections. The right pointing arrow places any command selected in the left pane onto the right pane, <abbrev>i.e.</abbrev>, it is added to the toolbar. The left arrow does just the opposite, removing any action selected in the right window from the toolbar. The up and down pointing arrows change the position of an action selected in the right window which changes the position of its button in the toolbar.</para> </listitem>
<para>Selecting <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure Editor</guimenuitem></menuchoice> from the menu brings up the <guilabel>Configure Editor</guilabel> dialogue box. This dialogue can be used to alter a number of different settings. The settings available for change vary according to which category the user chooses from a vertical list on the left side of the dialogue. By means of three buttons along the bottom of the box the user can control the process. </para>
<para>She or he may invoke the <guilabel>Help</guilabel> system, accept the current settings and close the dialogue by means of the <guibutton>OK</guibutton> button, or <guibutton>Cancel</guibutton> the process. The categories <guilabel>Colours</guilabel>, <guilabel>Fonts</guilabel> <guilabel>Indent</guilabel>, <guilabel>Select</guilabel>, <guilabel>Edit</guilabel>, <guilabel>Spelling</guilabel> and <guilabel>Highlighting</guilabel> are detailed below. </para>
<para>This section provides access to <link linkend="pref-color-settings">two different colour settings</link>, described below. Each of these settings may be changed by clicking on its corresponding button. These are special wide buttons that are the colour of the current setting. Clicking on one of the buttons calls a special colour dialogue box used to change the setting.</para>
<para>The colour dialogue box provides a convenient and graphical way to select a colour. In the upper left of the box is a rectangular display of a spectrum of colours. To the immediate right of this, is vertical bar displaying a range of intensity from the most dark at the bottom to the most light at the top. The user may select and adjust a colour by clicking in these two boxes. Clicking in the rectangular display selects a particular mix of red, green, and blue colours and in the vertical bar selects a level of intensity (value). The various colour attributes are displayed in numerical form in small text boxes located directly below the spectral rectangle and the user can see them change as the colour is adjusted. These attributes include the mix of the basic colour components (red, green, and blue) as well as hue and saturation levels. Alternatively the user can enter figures directly in these boxes. There is also a square at the bottom centre of the dialogue box which displays the colour which is under consideration at any time. To the right of this display is another text box labelled <guilabel>HTML:</guilabel> This shows the user the colour code that would be used to specify the particular displayed colour in <acronym>HTML</acronym> code which is widely used for web pages.</para>
<para>In addition to the above, the colour dialogue allows the capture of any colour currently displayed on the desktop or in another program. Clicking on the button with the dropper icon (located on the right side of the dialogue box,) changes the shape of the mouse cursor to a set of crosshairs. Clicking again will pick up the colour attributes of whatever colour is displayed under the cross hairs.</para>
<para>Furthermore the user has the option of adding any colour to a personal palette of <quote>Custom Colours</quote> by clicking on the wide button labelled <guibutton>Add to Custom Colours</guibutton> (which is located directly above the display square.) This adds the current colour to the custom colour palette. This palette and any other available palettes can be displayed using the drop down selection box located directly above the palette display at the top right of the dialogue box. Besides the custom colours, the user can access a number of pre-prepared palettes.</para>
<variablelist>
<varlistentry id="pref-color-settings">
<term><guilabel>Background</guilabel></term>
<listitem><para>Here the user can specify a colour for the general background of &kwrite;.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Selected</guilabel></term>
<listitem><para>This allows the user to select a colour to be used for indicating selected (or highlighted) portions of the document.</para></listitem> </varlistentry>
<para>Here you can choose the default font for &kwrite;. You can choose from any font available on your system, and set a default size and encoding. A sample text displays at the bottom of the dialogue, so you can see the effect of your choices. </para>
<term><guilabel>Auto Indent</guilabel></term> <listitem><para>This causes new lines to begin with the same indentation level as the previous line.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Indent With Spaces</guilabel></term> <listitem><para>This replaces tabs with the number of spaces selected in the Tab Width window in the <link linkend="pref-edit">Edit</link> section of the preferences dialogue.</para></listitem>
<listitem><para>This allows the <keycombo action="simul"><keycap>backspace</keycap></keycombo> key to be used to indent.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Tab Key Indents</guilabel></term> <listitem><para>This allows the <keycombo action="simul"><keycap>tab</keycap></keycombo> key to be used to indent.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Keep Extra Spaces</guilabel></term>
<listitem><para>Indentations of more than the selected number of spaces will not be shortened.</para></listitem>
<term id="pref-word-wrap"><guilabel>Static Word Wrap</guilabel></term>
<listitem><para>Word wrap is a feature that causes the editor to automatically start a new line of text and move (wrap) the cursor to the beginning of that new line. &kwrite; will automatically start a new line of text when the current line reaches the length specified by the <link linkend="pref-wrap-words-at">Wrap Words At:</link> option.</para></listitem>
</varlistentry>
<varlistentry>
<term id="pref-wrap-words-at"><guilabel>Wrap Words At:</guilabel></term><listitem><para>If the <link linkend="pref-word-wrap">Word Wrap</link> option is selected this entry determines the length (in characters) at which the editor will automatically start a new line.</para></listitem>
</varlistentry>
<varlistentry>
<term id="pref-replace-tabs-by-spaces"><guilabel>Replace Tabs By Spaces</guilabel></term> <listitem><para>&kwrite; will replace any tabs with the number of spaces indicated in the <link linkend="pref-tab-width">Tab Width:</link> entry.</para></listitem>
</varlistentry>
<varlistentry>
<term id="pref-tab-width">Tab Width</term> <listitem><para>If the <link linkend="pref-word-wrap"><guilabel>Replace Tabs By Spaces</guilabel></link> option is selected this entry determines the number of spaces with which the editor will automatically replace tabs.</para></listitem>
<listitem><para>&kwrite; will automatically eliminate extra spaces at the ends of lines of text.</para></listitem> </varlistentry>
<varlistentry>
<term><guilabel>Auto Brackets</guilabel></term> <listitem><para>When the user types a left bracket ([, (, or {) &kwrite; automatically enters the right bracket (}, ), or ]) to the right of the cursor.</para></listitem>
<listitem><para>This option changes the behaviour of the cursor when the user presses the <keycap>Page Up</keycap> or <keycap>Page Down</keycap> key. If unselected the text cursor will maintain its relative position within the visible text in &kwrite; as new text becomes visible as a result of the operation. So if the cursor is in the middle of the visible text when the operation occurs it will remain there (except when one reaches the beginning or end.) With this option selected, the first key press will cause the cursor to move to either the top or bottom of the visible text as a new page of text is displayed. </para></listitem>
<listitem><para>When this option is chosen, moving the cursor with the arrow keys off the end of a line (to the right) causes it to jump down to the beginning of the next line. Likewise when the cursor is moved past the beginning of a line (to the left) it jumps up to the end of the preceding line. When this option is not selected, moving the cursor right past the end of a line merely causes it to continue horizontally in the same line and trying to move it left past the beginning does nothing.</para>
<para>When this option is chosen, clicking with the mouse past the end of a line of text will place the insert cursor <emphasis>at the end of the text</emphasis>, and not in the place you clicked. This avoids accidentally adding an empty space in the middle of text, and is the default behaviour of most editors. </para>
<term><link linkend="undo">Undo</link> steps:</term> <listitem><para>Here the user may specify the number of steps &kwrite; will retain in memory for purposes of undoing entries and actions. This means that the higher the number of steps set the more memory &kwrite; will use for this. Setting this entry to 10 would mean that the user would be be able reverse the last ten operations, <abbrev>i.e.</abbrev> click the <guibutton>undo</guibutton> button 10 times and obtain results.</para></listitem> </varlistentry>
<title>Spelling</title> <para>A spell checker is a program designed to help the user catch and correct any spelling errors. This section of the preferences dialogue allows certain important settings to be adjusted in this regard.</para>
<term><guilabel>Create root/affix combinations not in dictionary</guilabel></term> <listitem><para>Selecting this option allows the spell checker to register as 'correct' combinations of root words with suffixes or prefixes even if the particular combination is not listed in its dictionary data base of words.</para></listitem>
<term><guilabel>Consider run-together words as spelling errors</guilabel></term> <listitem><para>Selecting this will cause the spell checker to register as 'misspelled' two or more correctly spelled words that are 'run-together', <abbrev>i.e.</abbrev>, that do not have spaces separating them.</para></listitem>
<term><guilabel>Dictionary:</guilabel></term> <listitem><para>Depending on the user's installation one or more different language spelling dictionaries may be available. This drop down box allows the user to choose which language the spell checker should use.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Encoding:</guilabel></term> <listitem><para>There are different coding systems used to associate particular codes with particular characters and symbols. If the user knows which code he or she is using this drop down box allows this code to be specified so that the spell checker can do its job correctly. </para></listitem> </varlistentry>
<term><guilabel>Client:</guilabel></term> <listitem><para>Since &kwrite; does not contain its own spell checker, an external one must be chosen. This is where the user may specify which spell check program to use.</para></listitem> </varlistentry>