VIM shortcuts

Duplicate line

Position cursor at the line you want to copy or cut.

yy or y to copy the then either:

  • p to paste the copied or deleted text after the current line
  • or P to paste the copied or deleted text before the current line

Copy, Cut, Paste

Position the cursor where you want to begin cutting.

  • Press v to select characters (or uppercase V to select whole lines).
  • Move the cursor to the end of what you want to cut.
  • Press d to cut or y to copy (yank).
  • Move to where you would like to paste. Press P to paste before the cursor, or p to paste after.

Published by IndieForger