the kwrite handbook

thad mcginnis

jochen wilhelmy

glen parker

michael koch

christian tibirna

lauri watts

2.00.00

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.


Table of Contents

1 introduction
2 some fundamentals
drag and drop
command line options
specify a file
specify a file on the internet
other command line options
key bindings
3 the menu entries
the file menu
the edit menu
the go menu
the tools menu
the settings menu
the help menu
4 configure kwrite
colors
indent
select
edit
spelling
5 highlighting
6 credits and licenses
A installation

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 colorized syntax, customized 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.

file->new (ctrl-n)

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.

file->0pen (ctrl-o)

this command opens a file. it does this by means of a dialog box which allows the user to navigate the file system. the dialog operates like a small file manager. clicking on directories displayed in the central window directs the dialog to enter that directory - displaying its contents. there is an entry/dropdown box which can be used to type in directly the location and name of the file or by clicking the arrow at the side choose from a dropdown list of recently used locations. below this is a filter which similarly may have data entered directly or chosen from a dropdown list of recent filter types. the filter facility lets only files that meet its specifications be displayed in the central window. if the filter contained text such as *.txt then only files with the txt extension would be visible in the selection window. below the filter is a status bar giving information about the number of files and subdirectories within the current directory.

the toolbar, which is located at the top of the dialog, has left and right arrow buttons that let the user move back and forth through previously selected directories as well as an up arrow button for moving up the directory tree. the button with the little house takes the user to his or her home directory and the one with the two arrows curved in on each other updates the view of the current directory. the flag button lets the user set a new bookmark at the current directory or go to one that was previously set. the last button on the toolbar allows you to create a new directory, and finally there is dropdown box with a list of some commonly frequented directories.

file->open recent

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.

file->save (ctrl-s)

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 dialog (described below) will be invoked.

file->save as

this allows a document to be saved with a new file name. this is done by means of the file dialog box described above in the open section of this help file.

file->print (ctrl-p)

opens a simple print dialog allowing the user to specify what, where, and how to print

file->new window

this creates a new window, i.e. a new instance of kwrite. in this way the user can easily work on more than one file at a time with kwrite.

file->new view

this creates a new view of the current document, i.e., a new instance of kwrite (as explained in the previous entry) but containing the same document.

file->quit (ctrl-q)

this will close the editor window, if you have more than one instance of kwrite running, through the new view or new window menu items, those instances will not be closed.

edit->undo (ctrl-z)

this is used to eliminate or reverse the most recent user action or operation. just what constitutes such an action may be better understood by referring to the group undos portion of this help file.

edit->redo (ctrl-shift-z)

this will reverse the most recent change (if any) made using undo

edit->undo/redo history

this will call a display box showing a list of the most recent actions on the left and another list of actions which have been 'undone' on the right. there are also three buttons at the right of the box labeled undo, redo, and close. clicking on the undo button will cause the action at the top of the undo list to be reversed which will place that particular action at the top of the redo list. likewise, clicking on the redo button will reinstate the reversed action and move it back to the top of the undo list. clicking on an item below the top item in either list will select all the items from the top down to that point. a subsequent click on the corresponding button will cause all the selected actions to be undone or redone accordingly. this would be particularly useful when the user knows precisely the point to which she or he would like to proceed - making it unnecessary to go through a series of single undo or redo actions.

edit->cut (ctrl-x)

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.

edit->copy (ctrl-c)

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.

edit->paste (ctrl-v)

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.

edit->select all (ctrl-a)

this will select the entire document. this could be very useful for copying the entire file to another application.

edit->invert selection

this selects any unselected text while unselecting any selected text - effectively reversing the current state of selection.

edit->find (ctrl-f)

this opens the find dialog 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.

edit->find next (f3)

this repeats the last find operation, if any, without calling the find dialog box.

edit->replace (ctrl-r)

this command opens the replace dialog box. the replace dialog is almost identical to the above-mentioned find dialog. in addition to the features in the find dialog it contains a replace with: text entry/dropdown box. using this dialog 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.

edit->insert file

this opens the file open dialog box whereby the user can insert a complete file in the open document. the the contents of the file will be entered at the position of the blinking text cursor.

tools->spelling...

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 dialog box through which the user can control the process. there are three text boxes lined up vertically in the center of the dialog with their corresponding labels just to the left. starting at the top they are:

on the right side of the dialog box are 6 buttons that allow the user to control the spell check process. they are:

located horizontally along the bottom of the spell check dialog is a progress bar. as the checking process proceeds the bar will fill from left to right providing a graphical representation of how far along in the document the process has reached. in addition, the progress is displayed numerically in the center of the progress bar.

Note

a numerical display of the spell check process is simultaneously displayed in the status bar of the editor. the status bar is the horizontal strip at the bottom of the editor just outside of the text entry area.

two more buttons are located below the progress bar. they are:

settings->show toolbar

when checked, this displays a movable toolbar containing buttons used to initiate frequently used commands. when unchecked the toolbar is hidden.

settings->show statusbar

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.

settings->show path

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.

settings->configure key bindings

this command opens a dialog box whereby the key bindings may be changed. a display window at the top of the dialog 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 dialog. 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.

settings->configure toolbars

this will open the dialog 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.

settings->preferences

this menu item opens a dialog whereby several different settings may be adjusted.

settings->configure highlighting

opens a dialog box allowing configuration of the syntax highlighting. the dialog is described in Chapter 5. highlighting.

settings->vertical selection

this is used to turn on or off the vertical selection feature. vertical selection allows text to be selected by column as well as by row. in other words with this feature the user is able to select text contained in only particular contiguous columns and rows. in affect the user can select a rectangular area of text anywhere in the document.

settings->highlight mode

this allows the user to choose the style of color highlighting which the editor uses to display the text. the styles are selected by programming language. the font/color information is not stored with the document.

settings->end of line

this opens a sub-menu from which the user can select the type of ‘end of line’ code for kwrite to use, i.e., the accepted standard used by unix, mac® or msdos/windows® systems.

selecting settings->configure kwrite from the menu brings up the configure-kwrite dialog box. this dialog 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 dialog. 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 dialog by means of the ok button, or cancel the process. the categories colors, indent, select, edit, and spelling are detailed below.

this section provides access to five different color settings, described below. each of these settings may be changed by clicking on its corresponding button. these are special wide buttons that are the color of the current setting. clicking on one of the buttons calls a special color dialog box used to change the setting.

the color dialog box provides a convenient and graphical way to select a color. in the upper left of the box is a rectangular display of a spectrum of colors. 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 color by clicking in these two boxes. clicking in the rectangular display selects a particular mix of red, green, and blue colors and in the vertical bar selects a level of intensity (value). the various color 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 color is adjusted. these attributes include the mix of the basic color 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 center of the dialog box which displays the color which is under consideration at any time. to the right of this display is another text box labeled html: this shows the user the color code that would be used to specify the particular displayed color in html code which is widely used for web pages.

in addition to the above, the color dialog allows the capture of any color currently displayed on the desktop or in another program. clicking on the button with the dropper icon (located on the right side of the dialog box,) changes the shape of the mouse cursor to a set of crosshairs. clicking again will pick up the color attributes of whatever color is displayed under the cross hairs.

furthermore the user has the option of adding any color to a personal palette of “custom colors” by clicking on the wide button labeled add to custom colors (which is located directly above the display square.) this adds the current color to the custom color 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 dialog box. besides the custom colors, the user can access a number of pre-prepared palettes.

word wrap

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.

wrap words at:

if the word wrap option is selected this entry determines the length (in characters) at which the editor will automatically start a new line.

replace tabs by spaces

kwrite will replace any tabs with the number of spaces indicated in the tab width: entry.

tab width

if the replace tabs by spaces option is selected this entry determines the number of spaces with which the editor will automatically replace tabs.

remove trailing spaces

kwrite will automatically eliminate extra spaces at the ends of lines of text.

auto brackets

when the user types a left bracket ([,(, or {) kwrite automatically enters the right bracket (}, ), or ]) to the right of the cursor.

group undos

groups of similar actions are to be considered a single undo step by kwrite. in other words, a series of regular character keystrokes (words or expressions) would be considered one step and therefore be removed by a single undo operation. if the series of character entries were interrupted by a non-character entry operation (such as a backspace), invoking undo would only remove the entries made since that operation. the next undo would then reverse that operation and so on.

when this option is not selected kwrite considers each keystroke to be a single step. so if the user (with this option active) were to type several words or even sentences without having to make corrections or cut or paste or some other non-character entry operation then a click of the undo button would eliminate all that had been typed since the last non-entry operation. a second click would eliminate that operation and a third any operation or series of entries that occurred before the operation and so on. when not selected three clicks of the undo button would only remove the last three letters typed, or the last three operations.

show tabs

the editor will display a symbol to indicate the presence of a tab in the text.

smart home

not yet implemented

page up/down moves cursor

this option changes the behavior 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.

wrap cursor

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.

undo steps:

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.i>, click the undo button 10 times and obtain results.

the configure highlighting dialog consists of two pages, defaults and highlighting modes. the user can select which page to view by clicking on the appropriate tab at the top of the dialog

items available on the defaults page are as follows:

default item styles

the user can configure the default appearance for particular items. this would allow a programmer to more easily identify different items (types of entries) in his or her code.

default font

here the user can choose the default font for all text.

items on the highlight modes tab allow the user to define more specific highlighting depending on the language style.

one need not set every available option, items not configured specifically will use the default configuration specified on the previous (defaults tab.

config select

this group of options is used to customize the highlighting styles for each programming language type. any changes you made in other areas of this dialog apply only to this type.

as an example, if the user wished to configure the appearance of “comments” while writing c++, she or he could choose c++ in the highlight drop down list, and then choose comment in the item drop down list. to have “comments” look the same across all languages, the user would need to configure this in the defaults page of this dialog box while leaving “comments” unconfigured within the more specific highlight modes page.

item style

here the user can configure the general appearance of the above selected item. checking the default checkbox causes the default style as configured on the previous tab to be set, or the appearance can be configured directly. the available options are the same as on the defaults tab: normal, selected, bold and italic.

highlight auto select

kwrite can apply syntax highlighting automatically, depending on the file extension or mime-type of the opened file. the defaults are fairly comprehensive, but users that regularly edit files with non-standard extensions can add them here. wildcards are allowed in the file extensions text box. for example, the default entry for the c++ language is *.cpp;*.cc;*.c;*.h. opening a file called foo.h would automatically apply the c++ style to it.

item font

here the user can choose the font for the selected item.

the default style can be applied by checking the default checkbox or the user can choose a specific font family, size and charset. the available options are the same as those on the defaults tab.

kwrite copyright 2000 by jochen wilhelmy <digisnap@cs.tu-berlin.de>

contributions:

documentation by thad mcginnis <ctmcginnis@compuserve.com>

converted to docbook/proofreading by lauri watts <vampyr@atconnex.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.

kwrite is packaged as part of the kdebase package. for more information on installing and compiling kde please see www.kde.org.