Skip to content

Bdelete unable to delete multi buffers #6

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
sheeaza opened this issue May 24, 2016 · 5 comments
Open

Bdelete unable to delete multi buffers #6

sheeaza opened this issue May 24, 2016 · 5 comments

Comments

@sheeaza
Copy link

sheeaza commented May 24, 2016

when I try to delete multi buffers with
:Bdelete 4 6
it doesn't work leaving the words like this
"no math for 4 6"
4 and 6 are buffers' name

@moll
Copy link
Owner

moll commented Mar 3, 2018

Thanks for letting me know. You're right, this case isn't handled right now. At some point I guess it should be. :)

@vds2212
Copy link

vds2212 commented Jan 9, 2023

Thanks very much for BBye :-)

In the same spirit I noticed that Bdelete doesn't support range:

:%Bdelete

Is there a good reason for that or are you open for a Pull-request implementing it?

@vds2212
Copy link

vds2212 commented Jan 23, 2023

I have created a Pull request #21 that support:

  • Multiple arguments: :Bdelete 2 4 5
  • Ranges: :%Bdelete, :2,4Bdelete or :2Bdelete

@sheeaza sheeaza closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2023
@moll
Copy link
Owner

moll commented Sep 23, 2023

Thanks again. I'll leave this open instead if you don't mind as a reminder to come back to it someday and review whether the built-in :bdelete supports multiple buffers and under what syntax.

@moll moll reopened this Sep 23, 2023
@vds2212
Copy link

vds2212 commented Sep 27, 2023

Thanks for your interest for the pull request.

Here is the corresponding excerpt from the documentation

:[N]bd[elete][!]			*:bd* *:bdel* *:bdelete* *E516*
:bd[elete][!] [N]
		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.  Any windows for this buffer are
		closed.  If buffer [N] is the current buffer, another buffer
		will be displayed instead.  This is the most recent entry in
		the jump list that points into a loaded buffer.
		Actually, the buffer isn't completely deleted, it is removed
		from the buffer list |unlisted-buffer| and option values,
		variables and mappings/abbreviations for the buffer are
		cleared. Examples: >
		    :.,$-bdelete    " delete buffers from the current one to
				    " last but one
		    :%bdelete	    " delete all buffers
<

:bdelete[!] {bufname}						*E93* *E94*
		Like ":bdelete[!] [N]", but buffer given by name, see
		|{bufname}|.

:bdelete[!] N1 N2 ...
		Do ":bdelete[!]" for buffer N1, N2, etc.  The arguments can be
		buffer numbers or buffer names (but not buffer names that are
		a number).  Insert a backslash before a space in a buffer
		name.

:N,Mbdelete[!]	Do ":bdelete[!]" for all buffers in the range N to M
		|inclusive|.

In particular the following are valid commands:

Multiple arguments: :bdelete 2 4 5
Ranges: :%bdelete, :2,4bdelete or :2bdelete

And the pull request intention is only to provide their :Bd counterpart.

The one that I'm using the most is :%Bd.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants