本文介绍了如何在Vim中删除多个缓冲区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有多个文件在Vim中作为缓冲区打开。这些文件有 *。cpp *。h ,有些是 *。xml 。我想使用:bd * .xml 关闭所有XML文件。但是,Vim不允许这样做(E93:不止一场比赛...)。

Assuming I have multiple files opened as buffers in Vim. The files have *.cpp, *.h and some are *.xml. I want to close all the XML files with :bd *.xml. However, Vim does not allow this (E93: More than one match...).

有什么方法可以做到这一点?

Is there any way to do this?

PS我知道:bd file1 file2 file3 是可行的。所以我可以以某种方式将 *。xml 评估为 file1.xml file2.xml file3.xml 吗?

P.S. I know that :bd file1 file2 file3 works. So can I somehow evaluate *.xml to file1.xml file2.xml file3.xml?

推荐答案

您可以使用< C-a> 完成所有匹配。因此,如果您键入:bd * .xml 然后点击< C-a> ,vim将完成命令到:bd file1.xml file2.xml file3.xml

You can use <C-a> to complete all matches. So if you type :bd *.xml and then hit <C-a>, vim will complete the command to :bd file1.xml file2.xml file3.xml.

这篇关于如何在Vim中删除多个缓冲区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 13:08