Updated: 11 December 1998 |
OpenVMS User's Manual
Previous | Contents | Index |
With 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:
She rhymes with tree, She rhymes with tree, also with bee, and this one makes three. [End of file] |
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.
8.11.1 Selecting a Box of Text
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.
8.11.2 Cutting and Pasting a Box of Text
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.
Command | Function |
---|---|
BOX COPY | Copies a box of text without removing it, so you can paste it elsewhere. |
BOX CUT | Cuts a box of text so you can paste it elsewhere, usually padding the area with spaces to keep the column alignment of text to the right of the box. |
BOX CUT INSERT | Cuts a box, making text to the right of the box "collapse" to the left, closing the gap. |
BOX CUT OVERSTRIKE | Cuts a box, padding the area with spaces to keep the column alignment of text to the right of the box. |
BOX PASTE | Pastes a box of text you copied or cut, usually overwriting existing text. |
BOX PASTE INSERT | Pastes a box, pushing existing text to the right. |
BOX PASTE OVERSTRIKE | Pastes a box, overwriting existing text. |
BOX SELECT | Selects a box of text. Typically, you start at the upper left corner of the box and move the cursor to where you want the lower right corner. |
RESTORE BOX SELECTION | Puts back (undeletes) a box erased with pending delete, usually overwriting existing text. |
SET BOX NOPAD | Disables padding and overstriking for box editing unless the buffer is in overstrike mode. |
SET BOX NOSELECT | Default setting. Disables box selection, cutting, and pasting. Commands such as SELECT, COPY, and REMOVE use standard linear ranges. To edit boxes, use BOX commands. |
SET BOX PAD | Default setting. Enables automatic padding and overstriking for box editing, regardless of the buffer mode. |
SET BOX SELECT | Enables box selection, making commands such as SELECT, REMOVE, and INSERT HERE the same as the corresponding BOX commands, without having to redefine keys. |
Tutorial: Cutting and Pasting Text
To select and then cut and paste a box of text:
Rome Paris New York London Tunis Boston Tokyo Bonn Lisbon |
Rome New York Paris London Boston Tunis Tokyo Lisbon Bonn [End of file] |
Table 8-8 lists the SET BOX SELECT commands.
Command | Effect with SET BOX SELECT |
---|---|
INSERT HERE or PASTE | BOX PASTE |
REMOVE or CUT | BOX CUT |
RESTORE SELECTION | RESTORE BOX SELECTION |
SELECT | BOX SELECT |
STORE TEXT or COPY | BOX COPY |
You can then select, cut, and paste a box by using the Select, Remove,
and Insert Here keys, without having to redefine the keys.
8.12 Using Pending Delete
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.
8.12.1 Erasing a Selection with Pending Delete
To erase a selection using pending delete, follow these steps:
To 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.
8.13 Finding and Replacing Text
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.
Command | Function |
---|---|
FIND | Searches the current buffer for the text string you specify and highlights the found text. The text that is highlighted is called the found range. |
FIND NEXT | Searches for the string of text you last specified with the FIND, REPLACE, or WILDCARD FIND command. |
FIND SELECTED | Searches for a string of text you have selected, rather than for a typed string. The selection cannot cross more than one line. |
SET FIND CASE EXACT | Enables case-exact searches. This is particularly useful to find or replace search strings in lowercase letters only. |
SET FIND CASE NOEXACT | Default setting. Disables case-exact searches so that EVE finds any occurrence if you enter a search string in all lowercase letters. |
SET FIND NOWHITESPACE | Default setting. Sets FIND and WILDCARD FIND commands to match tabs and spaces exactly as you specify in the search string and to search for strings that are entirely on one line. |
SET FIND WHITESPACE | Sets FIND and WILDCARD FIND commands to treat spaces, tabs, and up to one line break as "white space" so you can search for strings of two or more words regardless of how they are separated. |
SET WILDCARD VMS | Default setting on OpenVMS. Enables OpenVMS patterns for WILDCARD FIND. |
SHOW WILDCARDS | Lists the wildcard patterns you can use with WILDCARD FIND. |
WILDCARD FIND | Searches for a pattern of text, using wildcards. |
Use 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.
8.13.1.1 When a Search String Is Found
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.
8.13.2 Setting Case-Exact Searches
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:
Command: SET FIND CASE EXACT Command: FIND digital |
To use the FIND command with the existing file RHYMES.DAT:
She rhymes with tree, also with bee, and this one makes thREE. [End of file] |
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:
You 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:
She rhymes with tree, also with bee, and this one makes thREE. [End of file] |
Use 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.
8.13.5 Marking Locations in Text
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:
Command | Function |
---|---|
MARK | Puts an invisible mark at the current cursor position. The mark exists for the rest of an editing session or until you change it; it is not saved when you exit. |
GO TO | Returns the cursor to the location labeled by the MARK command. If the labeled location is found in another buffer, EVE moves the cursor to the other buffer and puts that buffer into the current window. |
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.
8.13.6 Replacing Text
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.
8.13.6.1 REPLACE Command and Case Sensitivity
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:
Old String | New String | Highlight | Replacement |
---|---|---|---|
butter | margarine | butter | margarine |
Butter | Margarine | ||
BUTTER | MARGARINE | ||
BUtteR | margarine | ||
Butter | margarine | Butter | margarine |
butter | Margarine | butter | Margarine |
Butter | Margarine | ||
BUTTER | Margarine | ||
BUtteR | Margarine | ||
Butter | Margarine | Butter | Margarine |
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:
Old String | New String | Highlight | Replacement |
---|---|---|---|
butter | margarine | butter | margarine |
The default case setting is SET FIND CASE NOEXACT.
Previous | Next | Contents | Index |
Copyright © Compaq Computer Corporation 1998. All rights reserved. Legal |
6489PRO_016.HTML
|