Top 10 Underused KEDIT Features

Here are 10 useful KEDIT features that many users don’t take full advantage of:

1. The Command Line

KEDIT's menus, toolbars, and built-in key assignments can handle most standard editing tasks; the command line is there for those times when you need to do something a bit more specialized.

For example, you can use the Edit Replace menu item to change individual 'a's to 'b's, or to change all 'a's in the entire file or the current selection to 'b's. But what if you want to change just the first 3 'a's on each of the next 17 lines into 'b's? There is no good way to do this using Edit Replace, but it is easy to do using the command line:

For more about KEDIT’s command line, see Section 3.4 of the KEDIT for Windows User's Guide.

2. The Undo Facility

If you make a change to your file, or even a series of changes, and then have second thoughts, the Undo facility can reverse the effect of your changes. Use Alt+Backspace (or the Undo item in the KEDIT toolbar) to undo the most recent changes to a file.

For more about KEDIT’s Undo facility, see Section 3.13 of the KEDIT for Windows User's Guide.

3. Box Blocks

Box blocks mark rectangular areas of text, such as all text in columns 5 through 10 of lines 20 through 30 of a file. You can mark a box block by pressing Alt+B with the cursor in the upper left and then in the lower right corner of the text you want to work with. In KEDIT for Windows you can also mark box blocks by holding down the Alt key and dragging with the left mouse button down.

Box blocks are especially handy when you are working with data that is organized into columns. You can, for example, mark a column of data as a box block and then copy the data to the clipboard, or delete it, or uppercase it. If you mark a box block and then use the Actions Sort menu item, KEDIT will sort all of the lines that are marked, using the marked columns as the sort key.

4. The Macro Debugger

If you write KEDIT macros, the macro debugger can provide invaluable assistance. To get started debugging a KEDIT macro, use the command:

DEBUG macroname

You'll be able to single-step through your macro, and examine and change variable values while it runs.

The macro debugger is discussed in Section 10.4 of the KEDIT for Windows User's Guide.

5. The ALL Command

The ALL command lets you pick out a subset of your file that you want to focus on, such as all lines of a program that reference a particular variable, or all lines in a data file that contain a particular string. For example, the command:

ALL /Seattle/

causes KEDIT to display only the lines from your file that contain 'Seattle', and any changes you make will affect only that subset of your file. Use the ALL command with no operands to once again begin working with your entire file.

To learn more about the ALL command, see An Introduction to the ALL Command and All About ALL.

6. The TAG Command

The ALL command lets you limit your attention to lines containing some specified text. The TAG command has a slightly different purpose: it lets you continue to view and work with the entire file, but it highlights all of the lines containing a string that is of particular interest. For example, after the command:

TAG /Seattle/

you can still view and edit your entire file, but all lines that contain 'Seattle' will be highlighted.

7. Command Recall

Save typing--save time. KEDIT keeps track of the last 40 commands issued from the KEDIT command line. You can often save a lot of typing by using Ctrl+Cursor Up to redisplay previous commands on the KEDIT command line, which you can then edit if necessary and reissue. Ctrl+Cursor Up moves backward through the list of saved commands, and Ctrl+Cursor Down moves forward.

Even quicker: type the first character of the command on the command line before using Ctrl+Cursor Up, which will then only display previous commands that begin with that character.

8. Parenthesis Matching

Programmers often need to keep track of pairs of matching parentheses. To find a matching parenthesis, position the cursor at an opening or closing parenthesis, '(' or ')', and press Shift+F3. Shift+F3 also works with matching brackets, '[' and ']', and braces, '{' and '}'. The syntax coloring facility in KEDIT for Windows also uses different colors to indicate different levels of matching parentheses.

9. Targets

You are probably familiar with KEDIT's string targets, like '/book/', which let you look for a particular string. But you may not be as familiar with other types of targets, such as word targets and line class targets. Taking a small amount of time to learn about them can have a big payoff. Get started by reading Sections 1, 2, and 3 of the "Targets" chapter in the KEDIT User's Guide.

10. Regular Expressions

Even many experienced KEDIT users are not yet taking full advantage of the regular expression targets available in KEDIT for Windows. Regular expressions can be somewhat cryptic, and take some getting used to, but are worth the time invested. For example, here are a few things that can’t be done with normal KEDIT targets, but can be done using regular expressions:



To display all lines that end in a comma:

all regexp /,$/

To look for the next line containing a Social Security Number (for example, 041-22-0629) and nothing else:

locate regexp /^:d^3-:d^2-:d^4$/

To convert a file consisting of names listed in the form

Lastname, Firstname
to the form
Firstname Lastname
you could use this command:
change regexp /{:w}, {:w}/&2 &1/all

For a full discussion of regular expressions, see Section 6.6 of the KEDIT for Windows User's Guide.


KEDIT Home Page
KEDIT Overview | Download Libraries | Maintenance Releases
Ordering/Licensing | Demo Version | Technical Support | What's New
KEDIT for Windows 1.6.1 Upgrade | KEDIT Mailing List

Copyright © 1996-2012 Mansfield Software Group, Inc.