如何在 vi 编辑器之间进行切换而不退出?
我打开了两个 vi 编辑器:vi file1 file2
。现在file1首先打开,我想从file1中拉出一些行并将其放入文件2而不退出file1,因为可以拉动更多行,所以它只是在vi和拉动之间切换。
如何实现?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
:next
和:previous
在两个多个打开的文件之间导航(文件必须保存,它不允许切换当前文件)文件被“修改”)。You can navigate between
twomultiple open files with:next
and:previous
(the file has to be saved, it wont allow switching then the current file is "modified").不是每个文件都在自己的缓冲区中,您可以在缓冲区 1 处于活动状态时拉出文本,然后切换到缓冲区 2 并执行 put 操作吗?
顺便说一句,停止使用 vi 并切换到 vim(您可能已经在使用 vim,因为在某些 Linux 发行版上我很确定“vi”只是“vim”的链接)。
在 Vim 中,您实际上可以分割屏幕并同时查看两个缓冲区。
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.