Kon - The PM Text Editor with Power, Part 2

By: Walter Metcalf
Dateline: 11/03/99

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

  1. 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.

    1. Kon allows you to turn tabs on or off easily as you change from one of type of file to another.

    2. 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.

    3. 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.

  2. Regular and escape expressions

    Two types of expressions can be used with Find and Replace operations:

    1. Escape (Beginning with '\') characters.

      1. Hex characters: \xhh -- identified by leading x and two following hex digits (e.g. \x0a).

      2. Decimal characters: \ddd -- identified by three decimal digits (e.g. (\010).

    2. All regular Grep expressions. (See Find/Replace Help for details.)

      1. Kon allows these strings to be included in macros, which can greatly increase their power. 1

    3. 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 most situations.

      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:

      1. Keystroke Recordings.

        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.

        1. 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.)

        2. Click on Macro | Record again when you have completed the keystroke sequence.

        3. Select "Macro | Name Current Macro..." and then enter a brief, descriptive name of your new macro.

        4. 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.

      2. 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:

        1. Use the above procedure to record your macro as a series of keystrokes. Let's say you called the macro "Hot".

        2. Select Macro | Edit Macros... .

        3. Highlight your new macro, "Hot", and click on "Save".

        4. Select a convenient directory and and enter the filename "Hot.kbd".

        5. 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.

        6. Open the file "Hot.kbd" into its own window.

        7. Using the mouse, highlight the entire file, including the MACRO and END statements.

        8. Select Edit | Copy to copy the macro to the clipboard.

        9. Open the file "Standard.kbd", located in the Kon directory, into its own window.

        10. 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.

        11. 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.)

        12. 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.

        13. Now save and close the modified STANDARD.KBD file, close the rest of the files, and exit Kon.

        14. If desired, delete the keystroke macro "Hot" by selecting Macro | Edit Macros... and then selecting "Hot" and clicking on "Delete", "Yes" and "OK".

        15. The next time you start Kon, you should be able to activate the special sequence Ctrl-Shift-W to activate your macro.

      3. Programmable Undo/Redo

        1. Amount of RAM reserved for Undo/Redo is programmable using the Settings notebook.

        2. 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.

      4. Programmable Word-wrap

        The following word-wrap features can be configured:

        1. Right margin position;

        2. Wrap current line only or whole paragraph while typing;

        3. Use [Lf] as a soft end-of-line character and [CrLf] as end-of-paragraph.

        4. Reflow single or multiple paragraphs to new margin on command.

      5. Column block

        Vertical columns (i.e. rectangles) can be selected, cut, moved, or copied.

      6. Print Options

        1. Kon can print a block of selected text.

        2. Kon can print to a file.

        3. Kon can accept specific printer codes when printing to a printer.

        4. Kon allows limited page formating when printing to a printer.

      7. Multiple Files

        1. Kon is a memory editor: it loads the complete file into memory, which allows greater speed.

        2. Kon can have up to 25 files open simultaneously.

        3. Kon lets you easily copy and paste between open files.

  3. Tips & Undocumented Hotkeys

    The following is a partial list of useful undocumented hotkeys.

    1. Ctrl-S : Find Text

    2. Ctrl-T : Delete Word

    3. F3 : Repeat Find

    4. Ctrl-LeftClick

      Loads a file from the Quick List (i.e. list of recent files) into current window.

    5. SaveAndQuit

      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.

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.

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.

Walter Metcalf

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