Drill 06: Registers

Use named registers, the yank register, and system clipboard.

Drill Exercises

Exercise 1: Yank Register

  1. yy - yank a line

  2. dd - delete another line

  3. p - pastes the DELETE (unnamed register)

  4. "0p - pastes the YANK (yank register)

Exercise 2: Named Registers

  1. "ayy - yank line to register a

  2. "byy - yank another line to register b

  3. Navigate elsewhere

  4. "ap - paste from a

  5. "bp - paste from b

Exercise 3: System Clipboard

  1. "+yy - yank line to clipboard

  2. Switch to another application

  3. Paste with Ctrl+V

  4. Copy something in another app

  5. In Neovim: "+p - paste from clipboard

Exercise 4: Black Hole Register

  1. yy - yank a line (want to keep it)

  2. "_dd - delete another line to black hole

  3. p - pastes original yank (not the delete!)

Exercise 5: View Registers

  1. :reg - view all registers

  2. :reg 0ab - view specific registers

Self-Assessment

Skill Comfortable?

"0p yank register

[ ] Yes [ ] Need practice

"ap named registers

[ ] Yes [ ] Need practice

"+p system clipboard

[ ] Yes [ ] Need practice

"_d black hole

[ ] Yes [ ] Need practice