Copyright © 2000, 2001 Thad McGinnis
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
KWrite is a text editor for KDE
Table of Contents
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, HTML, and Ada.
KWrite is very simple to use. Anyone that has used a text editor should have no problems.
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.
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.
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:
%
kwrite
/home/myhome/docs/myfile.txt
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:
%
kwrite
ftp://ftp.kde.org/pub/kde/Welcome.msg
The following command line help options are available
kwrite --help
This lists the most basic options available at the command line.
kwrite --help-qt
This lists the options available for changing the way KWrite interacts with Qt™.
kwrite --help-kde
This lists the options available for changing the way KWrite interacts with KDE.
kwrite --help-all
This lists all of the command line options.
kwrite --author
Lists KWrite's authors in the terminal window
kwrite --version
Lists version information for Qt™, KDE, and KWrite. Also available through kwrite
-V
Many of the key bindings (shortcuts) are configurable by way of the Settings menu. By default KWrite honours the following key bindings.
Insert | 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. |
Left Arrow | Move the cursor one character to the left |
Right Arrow | Move the cursor one character to the right |
Up Arrow | Move the cursor up one line |
Down Arrow | Move the cursor down one line |
Page Up | Move the cursor up one page |
Page Down | Move the cursor down one page |
Backspace | Delete the character to the left of the cursor |
Home | Move the cursor to the beginning of the line |
End | Move the cursor to the end of the line |
Delete | Delete the character to the right of the cursor (or any selected text) |
Shift+Left Arrow | Mark text one character to the left |
Shift+Right Arrow | Mark text one character to the right |
F1 | Help |
Shift+F1 | What's this? |
Ctrl+F | |
F3 | |
Ctrl+C | Copy the marked text to the clipboard. |
Ctrl+B | Set a Bookmark |
Ctrl+N | New document |
Ctrl+P | |
Ctrl+Q | Quit - close active copy of editor |
Ctrl+R | |
Ctrl+S | Invokes the Save command. |
Ctrl+V | Paste the clipboard text into line edit. |
Ctrl+X | Delete the marked text and copy it to the clipboard. |
Ctrl+Z | |
Ctrl+Shift+Z |
This starts a new Document in the editor. If there is a current document with unsaved changes the user is given a chance to save it.
Displays a standard KDE Open File dialogue. Use the file view to select the file you want to open, and click on to open it. You can find more information about the KDE Open File dialogue in the KDE User Guide.
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.
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.
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 Open section of this help file.
Opens a simple print dialogue allowing the user to specify what, where, and how to print
This will close the editor window, if you have more than one instance of KWrite running, through the or menu items, those instances will not be closed.
This is used to eliminate or reverse the most recent user action or operation.
This will reverse the most recent change (if any) made using Undo
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.
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.
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.
This will select the entire document. This could be very useful for copying the entire file to another application.
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.
This opens the find dialogue which is used to specify the Text to Find 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 Case Sensitive will limit finds to entries that match the case (upper or lower) of each of the characters in the search pattern. Find Backwards directs the search to proceed in an upwardly direction. The Selected Text option keeps the search within currently selected text. Checking Whole Words Only prevents the search from stopping on words that contain the searched for pattern. The Search from Cursor option begins the search from the current position of the cursor within the document rather than from the beginning.
This repeats the last find operation, if any, without calling the find dialogue box.
This repeats the last find operation, if any, without calling the find dialogue box, and searching backwards instead of forwards through the document.
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 Replace With: 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 Prompt On Replace option allows the user to have KWrite ask for confirmation before each replacement.
At the bottom of this menu, a list of markers appears if any markers are available for this window.
This initiates the spell checking program - a program designed to help the user catch and correct any spelling errors. 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:
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.
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.
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 Replacement: box, above.
If you have installed multiple dictionaries, here you can select which dictionary/language should be used.
On the right side of the dialogue box are 5 buttons that allow the user to control the spell check process. They are:
Pressing this button adds the word in the Misspelled Word: box to the checker's dictionary. This means that in the future the checker will always consider this word to be correctly spelled.
This button has the checker replace the word under consideration in the document with the word in the Replacement: box.
This button causes the checker to replace not only the current Unknown word: but to automatically make the same substitution for any other occurrences of this Misspelled Word: in the document.
Activating this button will have the checker move on without making any changes.
This button tells the checker to do nothing with the current Unknown word: and to pass over any other instances of the same word.
This only applies to the current spell check run. If the checker is run again later it will stop on this same word.
Three more buttons are located horizontally along the bottom of the spell check dialogue. They are:
This invokes the KDE help system starting at the KWrite help pages (this document).
This button ends the spell check process, and returns to the document.
This button cancels the spell check process, all modifications are reverted, and you will return to your document.
This increases the paragraph's indentation by one step. The size of the step depends on the indentation settings.
This reduces the paragraph's indentation by one step. The size of the step depends on the indentation settings.
Not yet implemented
This adds one space to the beginning of the line where the text cursor is located or to the beginning of any selected lines.
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.
When checked, this displays a moveable toolbar containing buttons used to initiate frequently used commands. When unchecked the toolbar is hidden.
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.
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.
This menu item opens a dialogue whereby several different settings may be adjusted.
This command opens a dialogue box whereby the key bindings 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 Alt, click on the key button, and then press the K key on the keyboard. This would mean that anytime he or she held down the Ctrl and Alt buttons and pressed K (while using KWrite) the About KDE display box would be called.
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, i.e., 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.
Invokes the KDE Help system starting at the KWrite help pages. (this document).
Changes the mouse cursor to a combination arrow and question mark. Clicking on items within KWrite will open a help window (if one exists for the particular item) explaining the item's function.
Opens the Bug report dialogue where you can report a bug or request a “wishlist” feature.
This will display version and author information.
This displays the KDE version and other basic information.
Selecting -> from the menu brings up the Configure Editor 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.
She or he may invoke the Help system, accept the current settings and close the dialogue by means of the button, or the process. The categories Colours, Fonts Indent, Select, Edit, Spelling and Highlighting are detailed below.
This section provides access to two different colour settings, 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.
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 HTML: This shows the user the colour code that would be used to specify the particular displayed colour in HTML code which is widely used for web pages.
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.
Furthermore the user has the option of adding any colour to a personal palette of “Custom Colours” by clicking on the wide button labelled (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.
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.
This causes new lines to begin with the same indentation level as the previous line.
This replaces tabs with the number of spaces selected in the Tab Width window in the Edit section of the preferences dialogue.
This allows the backspace key to be used to indent.
This allows the tab key to be used to indent.
Indentations of more than the selected number of spaces will not be shortened.
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 Wrap Words At: option.
If the Word Wrap option is selected this entry determines the length (in characters) at which the editor will automatically start a new line.
KWrite will replace any tabs with the number of spaces indicated in the Tab Width: entry.
If the Replace Tabs By Spaces option is selected this entry determines the number of spaces with which the editor will automatically replace tabs.
KWrite will automatically eliminate extra spaces at the ends of lines of text.
When the user types a left bracket ([, (, or {) KWrite automatically enters the right bracket (}, ), or ]) to the right of the cursor.
The editor will display a symbol to indicate the presence of a tab in the text.
This option changes the behaviour of the cursor when the user presses the Page Up or Page Down 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.
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.
When this option is chosen, clicking with the mouse past the end of a line of text will place the insert cursor at the end of the text, 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.
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, i.e. click the button 10 times and obtain results.
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.
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.
Selecting this will cause the spell checker to register as 'misspelled' two or more correctly spelled words that are 'run-together', i.e., that do not have spaces separating them.
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.
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.
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.
KWrite Copyright 2001 by the Kate team.
Based on the original KWrite, which was Copyright 2000 by Jochen Wilhelmy (digisnap AT cs.tu-berlin.de)
Contributions:
Christoph Cullmann (cullmann AT kde.org)
Michael Bartl (michael.bartl1 AT chello.at)
Phlip (phlip_cpp AT my-deja.com)
Anders Lund (anders AT alweb.dk)
Matt Newell (newellm AT proaxis.com)
Joseph Wenninger (kde AT jowenn.at)
Jochen Wilhely (digisnap AT cs.tu-berlin.de)
Michael Koch (koch AT kde.org)
Christian Gebauer (gebauer AT kde.org)
Simon Hausmann (hausmann AT kde.org)
Glen Parker (glenebob AT nwlink.com)
Scott Manson (sdmanson AT altel.net)
John Firebaugh (jfirebaugh AT kde.org)
Original documentation by Thad McGinnis (ctmcginnis AT compuserve.com)
This version of the KWrite Handbook is based on the original by Christian Tibirna (tibirna AT kde.org)
Converted to docbook/proofreading by Lauri Watts (lauri AT kde.org)
Conversion to British English: John Knight (anarchist_tomato AT herzeleid.net)
This documentation is licensed under the terms of the GNU Free Documentation License.
This program is licensed under the terms of the GNU General Public License.
Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team