Vim:关闭所有缓冲区但这个缓冲区 [英] Vim: Close All Buffers But This One

查看:102
本文介绍了Vim:关闭所有缓冲区但这个缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何关闭 Vim 中除当前正在编辑的缓冲区之外的所有缓冲区?

How can I close all buffers in Vim except the one I am currently editing?

推荐答案

你可以从 vim.org 使用这个脚本:

You could use this script from vim.org:

http://www.vim.org/scripts/script.php?script_id=1071

只要把它放到你的 .vim/plugin 目录,然后使用 :BufOnly 命令关闭所有缓冲区,但活动缓冲区除外.你也可以在你的 .vimrc 中将它映射到你喜欢的其他地方.

Just put it to your .vim/plugin directory and then use :BufOnly command to close all buffers but the active one. You could also map it elsewhere you like in your .vimrc.

Github 上的源代码(通过 vim-scripts 镜像):https://github.com/vim-scripts/BufOnly.vim/blob/master/plugin/BufOnly.vim

Source on Github (via vim-scripts mirror): https://github.com/vim-scripts/BufOnly.vim/blob/master/plugin/BufOnly.vim

这篇关于Vim:关闭所有缓冲区但这个缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆