How do I close a single buffer (out of many) in Vim?
I open several files in Vim by, for example, running
vim a/*.php
which opens 23 files.
I then make my edit and run the following twice
:q
which closes all my buffers.
How can you close only one buffer in Vim?
Answer:
A word of caution: "w does not stand for write but for wipeout!"
More from manuals:
:bd
Unload buffer [N] (default: current buffer) and delete it from the buffer list. If the buffer was changed, this fails, unless when [!] is specified, in which case changes are lost. The file remains unaffected.
If you know what your're doing, you can also use :bw
:bw
Like |:bdelete|, but really delete the buffer.
想要看到更多学习笔记、考试复习资料、面试准备资料?
想要看到IBM工作时期的技术积累和国外初创公司的经验总结?
敬请关注:
[CSDN](https://blog.csdn.net/u013152895)
[简书](https://www.jianshu.com/u/594a3de3852d)
[博客园](https://www.cnblogs.com/vigorz/)
[51Testing](http://www.51testing.com/?15263728)