How to yank between vi editors, without quitting one?
I have opene开发者_运维百科d 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?
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").
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.
精彩评论