Tryer
Tryer

Reputation: 4050

VSCode and VSCodeVim extension: Copying and pasting across multiple VSCode instances

I have project1 and project2 being two separate project folders. I open them separately and simultaneously by typing code . in their respective folders.

In project1, suppose I yank a few lines from a file from within project1 with the intention of pasting this into another file within project2, the yank does not carry over to the other project. The pasting of the file in project2 is of the previous yank from inside project2.

Is there any clipboard/registers that are shared so that I can yank into these specific registers from project1 and then retrieve this register from within project2?

Upvotes: 0

Views: 2061

Answers (1)

Tryer
Tryer

Reputation: 4050

The answer to this was provided by the maintainer/developer of VSCodeVim here.

Essentially, usage of register * will serve the purpose. So, if one wants to yank from project 1, do thus:

"*yy (yank a line into register *)

Then, paste from this register in project 2

"*p

To make the * register the default, you can use the vim.useSystemClipboard setting.

Upvotes: 1

Related Questions