Gangmax Blog

自由之思想,独立之精神

Vim Tips

| Comments

Copy, cut and paste (From here)

  1. Position the cursor where you want to begin cutting;

  2. Press v to select characters (or uppercase V to select whole lines);

  3. Move the cursor to the end of what you want to cut;

  4. Press d to cut (or y to copy);

  5. Move to where you would like to paste;

  6. Press P to paste before the cursor, or p to paste after.

Copy and paste is performed with the same steps except for step 4 where you would press y instead of d:

  1. d = delete = cut

  2. y = yank = copy

Jump to (From here)

  1. $: go to the end of line;

  2. ^: go to the first non-whitespace character in the line;

  3. 0: go to the beginning of the line including whitespace.

Comments