Copy and Paste in Vim

A quick and easy guide on how to copy and paste using Vim

To copy and paste a chunk of code in Vim follow these instructions;

  • Place the cursor on the line you want to begin cutting.
  • Press V to select the entire line, or v to select from where your cursor is.
  • Move the cursor to the end of what you want to copy, using h,j,k, or l
  • Press y to copy it, or d to cut it.
  • Place the cursor where you would like to paste your copied stuff.
  • Press P to paste it before your cursor, or p to paste it after the cursor.

You can copy and paste between buffers.

And that is it! Now you can copy or cut and paste in vim!

Thanks to Paul for spotting a typo.


Recent posts View all

Web Dev

Render's Support

I'm really happy with Render's support and will be recommending them for people to consider

Web dev

Free tools to improve your website

There are lots of freely available tools to help get a sense check on how your website is doing and recommend improvements