Friday, November 2, 2012

Re: :bonly?

Am 02.11.2012 11:49, schrieb Paul:
> I don't see a command to delete all buffers except the current one
> (like :tabonly). Is it possible without a script?

Of course ... although you should not expect a one-click solution.

Just note that the :bd command accepts a range.

If you have around 20 buffers and the current buffer number is 7 (check
current buffer number with 2<C-G> ), you can do:
:1,6 bd| 8,99 bd

Variants:
:1,6 bd!| 8,99 bd! " discard modified buffers
:sil! 1,6bd| sil! 8,99bd " keep modified buffers
:conf 1,6bd| conf 8,99bd " ask what to do with mod. buffers
" do the same with :bun or :bw ...
etc.

Don't use ranges :8,$ or :%, these are still line-ranges (whether
buffers are affected depends on the number of lines in your buffer).

--
Andy

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment