Customizing the Editor

You can modify editor settings, assign keyboard commands, and emulate command sets from other editors to make the editor work the way you like. See the online reference system and Chapter 14, “Customizing the Microsoft Programmer's WorkBench,” in the Programmer's Guide for complete details.

Changing Editor Settings

The PWB editor has a variety of settings you can customize, such as word wrap, color, and width of tab stops.

View or modify the settings by choosing the Editor Settings command from the Options menu. The editor settings appear in a new window labeled “Current Assignments and Settings.” The format is setting:value, where setting is the name of the setting, and value is a Boolean, numeric, or text value. You can learn about a setting by positioning the cursor on it and pressing F1.

To change a setting, simply overtype the old value with a new one. The change does not take effect until you move the cursor to a different line. To save the changed assignments, press SHIFT+F2 (if the default keyboard assignments are in effect) or choose the Save command in the File menu. If you do not save, the assignments are temporary and last only for the duration of the PWB session.

To return to your source file, press F2.

Modifying Keyboard Assignments

Most editor functions (such as delete, home, and copy) are already assigned a keystroke combination for direct execution. You can reassign these functions to different keystrokes by choosing the Key Assignments command in the Options menu.

This command displays the current assignments on a screen labeled “Current Assignments and Settings.” Function assignments appear in the format function:keyname. You can learn about a PWB function by positioning the cursor on the function name and pressing F1. Press PGDN to view a list of unassigned keys following the assignment list.

To assign a new key to a function, replace keyname with the name of the new key. The change does not take effect until you move the cursor to a different line.

When you move the cursor, the line with the new assignment is highlighted. To make the assignment permanent, save the file by pressing SHIFT+F2 or by choosing the Save command in the File menu. This updates the TOOLS.INI file, where changes to key assignments are stored.

To remove a key assignment, assign the unassigned function to the key.

Using Advanced Editor Features

Most of the standard editing features in PWB are intuitive and easy to use. However, there are also many advanced editing options that allow you to customize and control the editor beyond simple menu commands.

The PWB editor incorporates all of the powerful features found in the Microsoft Editor. You can set a variety of functions and switches to further customize the PWB editor and enhance its performance. A complete list of editor functions and settings is available in the online reference system.

You can add new or altered functions and settings to the TOOLS.INI file so they are loaded when PWB starts, or you can enter them interactively while you are working in PWB.

For example, to assign a key command interactively to the editor's curdate function, which enters the current date at the cursor, first press ALT+A. (The display Arg[1] appears at the left end of the reference bar to show that you have pressed ALT+A once.) Type the following into the argument dialog box (note that the dialog box does not appear until you have typed the first character):

Curdate:SHIFT+CTRL+T

Press ALT+= to assign the key to the function.

Now when you press SHIFT+CTRL+T, the current date is inserted at the editor's cursor position.

For detailed information about advanced PWB features, refer to the Programmer's Guide and the online reference system.

Reconfiguring the Editor

PWB includes the BRIEF.INI file with key assignments that emulate the BRIEF editor. To use these key assignments, add the contents of this file to TOOLS.INI. You can also simulate command sets from other editors using the customization techniques described earlier.

Running Other Programs

One of PWB's most powerful features is its ability to run other programs without exiting to the command line. The Customize Menu command in the Run menu lets you add any program to the Run menu, where you can execute it simply by clicking its name. You can also specify any keystroke to run it directly.

After selecting Customize Menu, click the Add button in the Customize Menu dialog box that appears. The dialog box lets you type all the information PWB needs to successfully execute the program: its name, directory, command-line arguments, and so on. Note that you can give the program any name you like on the command line, and you can specify that the program run in the background.