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

Anyfactor
1 min readSep 1, 2018

--

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.

--

--

Anyfactor
Anyfactor

Written by Anyfactor

I rant about programming, freelancing and other stuff. www.anyfactor.xyz | @anyfactor

No responses yet