Mission 18 / 52• Basic Operators
Copy/Paste Lines
In Vim, copying is called **yanking** (`y`), and pasting is called **putting** (`p`).
Any text you delete with `d` or `x` also goes into the default register, meaning you can cut and paste with `dd` then `p`!
Yank and put
- yyyank (copy) the current line
- pput (paste) clipboard content BELOW the cursor
- Pput (paste) clipboard content ABOVE the cursor
1const itemA = { id: 1, name: "Alpha" };2const itemB = { id: 2, name: "Beta" };On `itemA`, press `yy`, move down to `itemB`, and press `p`. A duplicate line appears immediately below!
Now it's your turn!
- Navigate to each green target across the code snippet.
- Use the motions and techniques learned in this lesson to land accurately on each target.
- See how fast you can complete 10 targets.
0/10
1const itemA = { id: 1, name: "Alpha" };2const itemB = { id: 2, name: "Beta" };NORMAL
00:00
NextCtrl+jRelative Line Jumps