开发者

How to yank between vi editors, without quitting one?

开发者 https://www.devze.com 2023-03-26 07:41 出处:网络
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 yank

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消