RajSanpui
RajSanpui

Reputation: 12064

How to yank between vi editors, without quitting one?

I have opened two vi editors: vi file1 file2. Now file1 opens first, and i want to yank some lines from file1 and put it to file 2 without quitting file1, because more lines can be yanked, so it is just switching between vi's and yanking.

How to achieve it?

Upvotes: 0

Views: 137

Answers (2)

vstm
vstm

Reputation: 12537

You can navigate between two multiple open files with :next and :previous (the file has to be saved, it wont allow switching then the current file is "modified").

Upvotes: 2

Jay
Jay

Reputation: 435

isn't each file in its own buffer and you can yank the text while buffer 1 is active then switch to buffer 2 and do the put? Btw, stop using vi and switch to vim (you may already be using vim as on some linux distros i'm pretty sure that 'vi' is just a link to 'vim'). In Vim you can actually split the screen and see both buffers at the same time.

Upvotes: 0

Related Questions