Shwetanka
Shwetanka

Reputation: 5036

Copying text in clipboard to vim editor

I've a text file opened in another editor and want to copy some text from that file to another file opened in vim editor. I tried google and found "+p. But it's not working. It is pasting the last line that I removed using dd in the same file.

Upvotes: 2

Views: 1844

Answers (4)

Sreeja Das
Sreeja Das

Reputation: 1274

Copy the text from your other editor using

Ctrl+c.

Open your vim editor. Type the command

:set paste

Now press i to enter Insert mode and copy the text using Ctrl+v

Upvotes: 1

Nehal J Wani
Nehal J Wani

Reputation: 16639

To paste from clipboard, go to insert mode of VIM and then press

ctrl+shift+v. 

If you want the indenting to be maintained, for e.g, if you are copying a code, then you can save that too, by enable the paste option. To do that, write:

:set paste

Upvotes: 4

romainl
romainl

Reputation: 196826

Do Vim and PHPStorm are on the same machine?

Is Vim compiled with clipboard support? :echo has('clipboard') should return 1.

Upvotes: 2

mMontu
mMontu

Reputation: 9273

Try "*p. There are other special registers that can be used, as explained in :h clipboard.

Upvotes: 1

Related Questions