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?
You can also save your edits with ex commands. Type :w to save (write) your file but not quit vi; type :q to quit if you haven't made any edits; and type :wq to both save your edits and quit.
I use a variant of your solution: :%bd<CR><C-O>:bd#<CR> This will delete all buffers, then use <C-O> to get restore the position in the current file, then :bd# to remove the unamed buffer. This closes all buffers and leaves you in the same location in the file.
Permanently deleting your Buffer accountClick on your profile avatar at the top right of your dashboard and then click Account from the drop down menu. Click Delete My Buffer Account towards the bottom of the page. Enter your password and click Confirm.
Pressing Alt-F12 opens a window listing the buffers, and you can press Enter on a buffer name to go to that buffer. Or, press F12 (next) or Shift-F12 (previous) to cycle through the buffers.
A word of caution: “the w
in bw
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 you’re doing, you can also use :bw
:bw
Like |:bdelete|, but really delete the buffer.
If this isn't made obvious by the the previous answers:
:bd will close the current buffer. If you don't want to grab the buffer list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With