9.1 The vi Editor
9.1.7 Editing commands (command and last-line mode)
There are many editing commands that can be used to modify existing text in a file. These include commands for deleting, undoing, repeating, and changing text as well as those for copying and pasting. The majority of these commands are entered while in command mode. Commands preceded by a colon indicate to the user that the command is to be entered while in last-line mode.

Deleting Text
To delete text, you must be in command mode. While in command mode, position the cursor to the desired location and use the options shown in Figure to delete text. Note that these commands are case-sensitive and are entered without the Enter key.

Undoing, Repeating, and Changing Text
To change text, cancel or repeat edit functions, use the commands shown in Figure . Many of these commands change you to Insert mode until you press Escape.

Copying and Pasting Text
To copy and paste text, use the following options in Figure

Note - Both delete (dw and dd commands) and yank write to a buffer (memory). When yanking, deleting, and pasting, the put commands insert the text differently depending on whether you are pasting a word(s) or a line(s).