Chapter 8. The KWrite Text Editor

Table of Contents

8.1. The File Menu
8.2. The Edit Menu
8.3. The View Menu
8.4. The Bookmarks Menu
8.5. The Tools Menu
8.6. The Settings Menu
8.7. The Help Menu
8.8. Kate

Abstract

KWrite can be used to write simple texts or lists. As well as text editing, KWrite can also be used to view and edit various different types of source code or HTML with syntax highlighting. This chapter provides a brief overview of the main features of KWrite, introducing the main menus and tools.

Start KWrite from the main menu or using the command kwrite. The command can be entered on the command line together with the name of the file to open. As well as using the menu bar, the toolbar, and a number of shortcuts, you can right-click the opened document to access a context menu providing basic editor functions.

KWrite supports the drag and drop functions of KDE, which means that you can simply drag documents with the mouse from one application into another or paste data from the clipboard (see Section 5.4.4. “The Clipboard Klipper”). To edit a text file for which you have put an icon on the desktop, click the icon with the left mouse button and hold the button while dragging it into the editor window. You can now edit the file as usual. Paste text from the clipboard by middle-clicking. To edit or view the source code of an HTML page, drag the URL into the editor window of KWrite, keeping the left mouse button pressed.

Figure 8.1. The KWrite Text Editor

The KWrite Text Editor

8.1. The File Menu

New (Ctrl + N)

This creates a new file and, at the same time, opens a new KWrite window in which to start typing your text.

Open… (Ctrl + O)

Use this to open an existing file. It opens a file selection dialog that resembles a file manager. The left-hand area provides a number of quick navigation buttons to use to list the files in your home directory or on the floppy with just one click. Alternatively, use the entry field in the toolbar at the top or browse directories with the arrow buttons. As soon as a directory is selected, the files and subdirectories in it are listed in the right-hand part of the dialog. To speed things up, narrow down the list according to the file type by specifying the file extension (e.g., *.txt) under Filter.

To mark the current directory for quick return later, click the star button in the toolbar and create a bookmark for it. Any directory bookmarked in this way can subsequently be reached via the menu to avoid going through the entire file system again and again. Use the configuration menu accessible with the wrench button to customize the way in which the items in the dialog are sorted and viewed.

Save (Ctrl + S)

This saves the document in its current form. If you have been editing a new document, the program display a dialog with which to specify the name of the file and its location (directory).

Save As…

This opens a dialog in which to specify the name and the directory under which to save the document. The dialog is essentially the same as the one displayed after selecting File -> Open….

Print… (Ctrl + P)

This opens a simple dialog in which to define printing options for the document and start the print job.

Close (Ctrl + W)

This closes the currently loaded document. If there are changes that have not yet been saved, a dialog opens to ask whether to do so.

Quit (Ctrl + Q)

This exits the editor. If there are unsaved changes to a loaded document, KWrite shows a dialog asking whether to save before exiting.