![]() |
![]() HP OpenVMS Systems Documentation |
![]() |
OpenVMS User's Manual
8.10 Copying TextWith the COPY command, you can copy text elsewhere. The STORE TEXT command is the same as the COPY command. You can substitute the STORE TEXT command wherever the COPY command is used in the following example.
Tutorial: Copying Text
To copy text when the buffer is set in a forward direction:
8.11 Box Editing
You can edit text that has rectangular areas, or boxes, as well as
standard linear ranges. For example, you can select a box containing a
list or columns in a table, and then cut and paste the box or perform
some other editing operation on the box.
To select a box of text, follow these steps:
As you move the cursor, text that you cross is highlighted in bold video (a regular selection uses reverse video). The box is defined by diagonally opposite corners. If you move from upper left to lower right, the character that the cursor is on is outside the box, that is, the lower right corner of the box is left of the cursor. You can then edit the box by using any of the editing commands that ordinarily work on a linear or a rectangular range. You need not redefine keys. See the Extensible Versatile Editor Reference Manual for further information. You can use FIND SELECTED if the selection does not cross lines or OPEN SELECTED. You can also use pending delete. If you are going to make several box edits---for example, in editing multicolumn tables and lists---use the SET BOX SELECT command. SET BOX SELECT redefines several commands and keys as the corresponding BOX commands and makes other editing operations work on boxes instead of linear ranges.
To cancel a box selection, repeat SELECT or BOX SELECT, or use RESET.
Cutting a box usually pads the area with spaces to keep the column alignment of text to the right of the box. Pasting a box usually overwrites existing text. Tab characters in the box, or that overlap the box, are converted to spaces to keep the column alignment of text. Table 8-7 lists the EVE commands for box editing.
Tutorial: Cutting and Pasting Text
To select and then cut and paste a box of text:
8.11.3 SET BOX SELECT CommandsTable 8-8 lists the SET BOX SELECT commands.
You can then select, cut, and paste a box by using the Select, Remove,
and Insert Here keys, without having to redefine the keys.
You can use pending delete to erase selected text. Pending delete refers to erasing a selection by typing new text, pressing the space bar, or by using delete (typically, pressing the Delete key). With a box selection, pending delete works like BOX CUT, usually padding the area with spaces to keep the column alignment of text to the right of the box.
Pending delete gives you an alternative way of cutting and pasting text
because pending delete does not use the Insert Here buffer. For more
information about pending delete, see the EVE online help topic called
Pending Delete.
To erase a selection using pending delete, follow these steps:
8.12.2 Restoring a Selection That Was Erased with Pending DeleteTo put back (restore) the text you erased with pending delete, follow these steps:
Restoring a box works like BOX PASTE, usually overwriting existing text. When using the SET BOX NOPAD command, the effects of box editing depend on the mode that the buffer is in (insert or overstrike, as shown in the status line):
The buffer mode also affects erasing a box with pending delete and
restoring an erased box.
With EVE commands, you can search for specific text in a buffer. You can search for every occurrence of specific text, and you can search for text that is on a single line or spans a line break. Also, you can search for text using wildcards. This section describes methods for searching and replacing text. Table 8-9 describes the EVE commands that locate text in a buffer.
8.13.1 Finding TextUse the FIND command to locate specific text in the current buffer. By default, EVE defines the E1 key (Find key on VT200, VT300, and VT400 series terminals and the PF1 key on VT100 series terminals) as the FIND command. If the search string contains all lowercase letters, EVE disregards the case of letters and locates any occurrence of the string. Thus, the search string the matches the, THE, THe, and thE. If the search string contains one or more uppercase letters, EVE finds only the occurrences of the string in which the case of each letter is exactly the same. Therefore, the only match for the search string tHis is tHis. For example:
The current direction of the buffer determines whether EVE first searches in a forward or reverse direction. If EVE cannot find the string in the current direction but finds it in the opposite direction, EVE prompts you to change direction.
To search in the opposite direction, type YES (Y) and press the Return
key. EVE moves the cursor to the first occurrence of the string in the
opposite direction. The current direction in the highlighted status
line does not change, however.
When EVE finds the search string, the editor highlights it and moves the cursor to the first letter of the string. See the Extensible Versatile Editor Reference Manual for a listing of the editing commands you can use on a highlighted search string. To cancel the highlighting, move the cursor off the search string or use the RESET command.
To find the next occurrence of the search string, press the Find key
twice or enter the FIND NEXT command.
If you want to match the case of your search exactly when searching for lowercase occurrences of a string, enter the SET FIND CASE EXACT command. Then when you enter a search string in all lowercase letters, EVE searches only for lowercase occurrences, skipping occurrences that contain uppercase letters. The setting applies to the FIND, REPLACE, and WILDCARD FIND commands. You can save the setting in your section file or command file for future editing sessions. The default setting is SET FIND CASE NOEXACT. EVE is sensitive to diacritical (accent) marks and locates only those occurrences of the string in which the diacritical marks are exactly the same. For example, in searching for ë, EVE does not find occurrences of e, é, è, or ê. In the following example, the commands enable case-exact searching and then find digital when it appears in lowercase only, skipping occurrences such as Digital or DIGITAL:
To use the FIND command with the existing file RHYMES.DAT:
Tutorial: Using the FIND SELECTED Command
To use FIND SELECTED to search for a string that is particularly complicated or is easily misspelled or mistyped:
8.13.3 Using WildcardsYou can use wildcards to search for text. The SHOW WILDCARDS command displays wildcard patterns for the current wildcard setting. To learn how to use wildcards:
8.13.4 Including White Space in a SearchUse the SET FIND WHITESPACE and SET FIND NOWHITESPACE commands to specify how the WILDCARD FIND and FIND commands treat the blank spaces between words, such as spaces, tabs, and line breaks. The SET FIND NOWHITESPACE command enables the commands to search for multiword strings on a single line, matching spaces and tabs exactly as they are found. SET FIND NOWHITESPACE is the default search behavior.
The SET FIND WHITESPACE command enables the WILDCARD FIND and FIND
commands to search for a string of two or more words regardless of how
they are separated. It enables the FIND commands to search for a string
that contains a single line break and more than one space or tab
between words.
The MARK and GO TO commands are useful for editing a large file and then returning to a specific location later in the editing session. The following table describes the MARK and GO TO commands:
To mark your position, enter the MARK command followed by a label name
of your choice. The label name can be one or more printable characters,
including alphanumeric and punctuation characters, spaces, and tab
characters. To return the cursor to the marked location, enter the GO
TO command followed by the label name.
With the REPLACE command, you can replace a text string in the current
buffer with another text string. This is useful if you have spelled a
word incorrectly throughout a long file and you want to fix every
occurrence of the misspelled word.
The REPLACE command is case sensitive. If the old string has any uppercase letters, EVE searches for exact case matches. If the old string is all lowercase, EVE searches for any occurrence of the string regardless of its case. If the new string has any uppercase letters, EVE replaces the string exactly. If the old and new strings are all lowercase, EVE replaces the string according to the following rules:
The following table shows how EVE uses the case of the strings:
If you want to find or replace only lowercase occurrences of a string, enter the SET FIND CASE EXACT command. Then if you enter a search string in all lowercase, EVE searches for only lowercase occurrences, skipping occurrences that contain uppercase letters. The setting applies to FIND, REPLACE, and WILDCASE FIND commands. The following table shows how EVE searches for and replaces only lowercase strings when you enter the SET FIND CASE EXACT command:
The default case setting is SET FIND CASE NOEXACT.
|