Drill 06: Registers
Use named registers, the yank register, and system clipboard.
Prerequisites
Complete Session 06: Registers Deep Dive first.
Drill Exercises
Exercise 1: Yank Register
-
yy- yank a line -
dd- delete another line -
p- pastes the DELETE (unnamed register) -
"0p- pastes the YANK (yank register)
Exercise 2: Named Registers
-
"ayy- yank line to register a -
"byy- yank another line to register b -
Navigate elsewhere
-
"ap- paste from a -
"bp- paste from b
Exercise 3: System Clipboard
-
"+yy- yank line to clipboard -
Switch to another application
-
Paste with Ctrl+V
-
Copy something in another app
-
In Neovim:
"+p- paste from clipboard
Exercise 4: Black Hole Register
-
yy- yank a line (want to keep it) -
"_dd- delete another line to black hole -
p- pastes original yank (not the delete!)
Exercise 5: View Registers
-
:reg- view all registers -
:reg 0ab- view specific registers
Self-Assessment
| Skill | Comfortable? |
|---|---|
|
[ ] Yes [ ] Need practice |
|
[ ] Yes [ ] Need practice |
|
[ ] Yes [ ] Need practice |
|
[ ] Yes [ ] Need practice |