z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Changing text

z/OS UNIX System Services User's Guide
SA23-2279-00

To change existing text, use the c command the same way you use d. c is a combination of d and a—it deletes text, then begins to append text to replace what was deleted.
Command
Action
c$
Lets you change everything from the cursor's current position to the end of the line.
cL
Lets you change everything to the end of the page.
cc
Lets you change all of the current line, regardless of the cursor position.

Go to the beginning of the first line of vitest and type c$. vi puts a $ at the end of the line. The $ marks the end of the block of text that vi intends to change. If you now begin typing something like The rain in Spain, you type over the text that was previously on the line. If you keep typing, you eventually type over the $. The $ was never there -- it was just a marker to show the block of text to be replaced.

After a c command, the text you type shows up on the screen. This means that c puts you in Insert Mode. When you finish typing replacement text, you must press <Esc> to return to Command Mode.

You can enter any amount of text to replace existing text. For example, c$ only gets rid of part of a line, but you can enter many lines of replacement text.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014