The command commonly used command for cutting is d. This command deletes text from the file. The command is preceded by an optional count and followed by a movement specification. If you double the command by typing dd, it deletes the current line. Here are some combinations of these:
- d^
- deletes from current cursor position to the beginning of the line.
- d$
- deletes from current cursor position to the end of the line.
- dw
- deletes from current cursor position to the end of the word.
- 3dd
- deletes three lines from current cursor position downwards.
There is also the y command which operates similarly to the d command which take text from the file without deleting the text.
Pasting:
The commands to paste are p and P. The only differ in the position relative to the cursor where they paste. p pastes the specified or general buffer after the cursor position, while P pastes the specified or general buffer before the cursor position. Specifying count before the paste command pastes text the specified number of times.
Comments