如何在不关闭窗口的情况下删除 Vim 中的缓冲区?
我通常输入 :bd
来删除缓冲区,但是,它会导致窗口关闭产生不良副作用,这是我不希望的。
I usually type :bd
to remove the buffer, however, it results in undesirable side-effect of the window being closed which I do NOT want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我通常使用
:bn
(下一个缓冲区),然后使用:bd#
(删除备用缓冲区)。当然,您可以为此创建映射或命令。I usually use
:bn
(next buffer) followed by:bd#
(delete alternate buffer). You could create a mapping or command for this, of course.正常工作,直到一个缓冲区在多个窗口中打开为止。除非您想使用更大的脚本,否则已经足够了。
Works as it should until one buffer is open in several windows. Good enough unless you want to use the bigger scripts out there.
我不确定 Icecrime 的 bufclose 插件链接是否基于相同的东西,但 Vim Tips Wiki 通过脚本显示了几种不同的方法。 查看它们。
I'm not sure if icecrime's bufclose plugin link is based on the same thing, but the Vim Tips Wiki shows a couple of different approaches via a script. Check them out.
尝试 kwbdi(在缓冲区删除时保留窗口) 插件。对我来说效果很好。
Try kwbdi(Keep Window on Buffer Delete) plugin. Worked well for me.