Kon - The PM Text Editor with Power, Part 2
By: Walter Metcalf
Last week we introduced Kon,
looked at its impressive list of features, and then began looking at some of these features in more detail. This week
we'll conclude our review of Kon by finishing our examination of this selection of features:
| Screen Shots|
Kon is written by Bjorn Andersson, who is very
open to suggestions and bug reports. Kon can be downloaded as fully functional shareware from the author's
Web site for evaluation purposes for up to 30 days.
After that you should register it;
registration costs $20 U.S.
- Configurable tab key.
In any editor or word processor handling the tab key is always a problem. As a person who uses the tab key
a lot, but not consistently, I have to say that Kon's method of handling the tab key is as at least as good
any other editor/word processor I have encountered.
- Kon allows you to turn tabs on or off easily as you change from one of type of file to another.
- When tabs are turned off, Kon mimics the action of the tab key by entering the number of blanks
you specify in the configuration notebook. No tab characters are embedded in the text.
- When tabs are turned on, as might be useful when writing a program in C, for example, then
the tab characters are embedded in the text, so that the backspace key will delete them and will
mimic a "Back-tab" key.
Regular and escape expressions
Two types of expressions can be used with Find and Replace operations:
- Escape (Beginning with '\') characters.
- Hex characters: \xhh -- identified by leading x and two following hex digits (e.g. \x0a).
- Decimal characters: \ddd -- identified by three decimal digits (e.g. (\010).
- All regular Grep expressions. (See Find/Replace Help for details.)
- Kon allows these strings to be included in macros, which can greatly increase their power. 1
- Macro Support
While Kon doesn't have a complete macro language with if and else statements
like a few editors such as The Semware Editor Jr. from The Semware Corporation, it nonetheless has a powerful macro language, more than adequate for
Kon's macro language is similar to Describe's, in which each menu command has an equivalent macro
command, and in which each checkbox, radio button, etc. is represented by an option of the basic command.
This means there are two ways to use macros in Kon:
This is the simplest method for most purposes. Macros of this type are stored in a special macro
file, by default, the MACRO.KON file. This file is binary and cannot be edited.
Simply click on Macro | Record, and begin typing the desired keystroke sequence; mouse
operations, and menu selections can also be used, and they will be treated like keystrokes.
If you enter the wrong character, simply erase it, and enter the correct one. This will be
reproduced in the macro definition. (Of course too many such mistakes will begin to slow
the macro's performance, so you should make a special effort to be accurate.)
Click on Macro | Record again when you have completed the keystroke sequence.
- Select "Macro | Name Current Macro..." and then enter a brief, descriptive name of your
- Click on Macro, and notice the name of your new macro at the bottom of the item list.
To play your macro, simply click on Macro, then click on the name of your macro.
Attached to a hotkey.
This method is useful for certain sequences that are repeated very frequently. However great care
must be taken to not to use a hotkey already used by Kon, because Kon uses a large number of hotkeys. 2
Macros attached to hotkeys are stored in the keyboard file, by default, STANDARD.KBD. However,
unlike MACRO.KON, this file is formatted ASCII, and so can be edited. However, care must be taken
to always maintain a working backup, because an error in this file can prevent Kon from starting.
Perhaps Kon's biggest deficiency is that there is no clean-cut method for creating hotkey macros.
The procedure for doing so is both arcane and complicated:
- Use the above procedure to record your macro as a series of keystrokes. Let's say you called
the macro "Hot".
- Select Macro | Edit Macros... .
- Highlight your new macro, "Hot", and click on "Save".
- Select a convenient directory and and enter the filename "Hot.kbd".
- Click on "OK", and click on "OK" again.
You have now converted the binary keystroke macro into an ASCII macro. The next step
is to integrate the ASCII macro into the Keyboard file and assign it a hotkey.
- Open the file "Hot.kbd" into its own window.
- Using the mouse, highlight the entire file, including the MACRO and END statements.
- Select Edit | Copy to copy the macro to the clipboard.
- Open the file "Standard.kbd", located in the Kon directory, into its own window.
- Press [Ctrl-End] to go to the end of the file, press [Enter] and select Edit | Paste to insert the macro
from the clipboard into the keyboard file. The name of the macro is initially the name
you gave it when saving it. You can edit the file to change it if you wish. Just be sure
the name is not used elsewhere in STANDARD.KBD.
- Now pick a special key, or key-sequence (e.g. Ctrl-Shift-W) not currently in use, either
by Kon or application programs with which it might conflict.)
- On a line following the the macro , add this line to the STANDARD.KBD file:
"Hot : Ctrl-Shift-W" (without the quotes), starting in column 1.
- Now save and close the modified STANDARD.KBD file, close the rest of the files, and exit
- If desired, delete the keystroke macro "Hot" by selecting Macro | Edit Macros... and then
selecting "Hot" and clicking on "Delete", "Yes" and "OK".
- The next time you start Kon, you should be able to activate the special sequence Ctrl-Shift-W to
activate your macro.
- Programmable Undo/Redo
- Amount of RAM reserved for Undo/Redo is programmable using the Settings notebook.
- Undo/Redo function on a command basis, not a character basis;
- So if the last command was to cut a 10,000 character block, a single Undo will
replace all 10,000 characters! That can be a real time saver.
- Programmable Word-wrap
The following word-wrap features can be configured:
- Right margin position;
- Wrap current line only or whole paragraph while typing;
- Use [Lf] as a soft end-of-line character and [CrLf] as end-of-paragraph.
- Reflow single or multiple paragraphs to new margin on command.
- Column block
Vertical columns (i.e. rectangles) can be selected, cut, moved, or copied.
- Print Options
- Kon can print a block of selected text.
- Kon can print to a file.
- Kon can accept specific printer codes when printing to a printer.
- Kon allows limited page formating when printing to a printer.
- Multiple Files
- Kon is a memory editor: it loads the complete file into memory, which allows greater speed.
- Kon can have up to 25 files open simultaneously.
- Kon lets you easily copy and paste between open files.
- Tips & Undocumented Hotkeys
The following is a partial list of useful undocumented hotkeys.
- Ctrl-S : Find Text
- Ctrl-T : Delete Word
- F3 : Repeat Find
Loads a file from the Quick List (i.e. list of recent files) into current window.
This function saves and closes the current file; however the keystroke sequence attached
to it is complex, and on my system does not work. I suggest editting STANDARD.KBD,
searching for "SaveAndQuit" and replacing the current keystroke sequence with F5, which is
not used by Kon. Save and close STANDARD.KBD. This gives a single keystroke for this
frequently used function.
If you have not decided on a text editor, if your needs have changed, or if you are not satisfied with
your present editor, take Kon out for a test drive. You'll be glad you did.
Next week: PPWizard--the HTML, WEB, REXX, and IPF Preprocessor
1 There is a bug in Kon's macro generator, which prevents certain special characters such as the double-quote from being handled correctly. One workaround is to convert the macro into a hotkey macro. The author of the program has been informed, and he has assured me the problem will fixed soon.
2 Most hotkeys are listed in either the Help menu or in the STANDARD.KBD file.
Unless otherwise noted, all content on this site is Copyright © 2004, VOICE