Summarized: Copy and Paste to/from Vim from/to Other Programs!

Anyfactor
Anyfactor
Sep 1, 2018 · 1 min read

P only pastes the last thing you yanked (y)
vim has the ability to copy thinks to particular register, where you can store texts to use them later. Each letter in the keyboard corresponds to a particular register.

Copy/pasting inside vim

Example: to save something to a a register, highlight it then, "ay. Now, we have addressed the register a by typing "a and combining with y we have yanked(copied) to that register. Then similarly to paste in something from a particular register "ap.

Copy/pasting outside of vim

Copying

By default vim(command line vim) does not have access to the computers clipboard. Gvim(the graphical version of vim) has access to computers clipboard. To use the the computers clipboard in normal vim, + buffer/register can be used. So, "+y to yank to the + register. Now it is copied to computers clipboard, and paste it in the traditional way (ctrl + v)

Pasting

To paste something copied outside of vim "+p

Other tips

Modify the vim rc for fast copy pasting
Use P as it pastes before the letter on cursor. p pastes after a letter.

Written by

Anyfactor

Freelance Python Developer. Web Scraper. Learning Data Analytics & Viz, and Web dev. anyfactor.xyz

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade