Am 10.08.2014 20:33, schrieb Marcin Szamotulski:
On 15:51 Sun 10 Aug     , Bram Moolenaar wrote:

I wrote:

Marcin Szamotulski wrote:

I wrote a patch which adds [count] to :colse, :hide and ^Wc normal
command.  When given the window with window number [count] will be
closed/hidden.  Sometimes I want to close not the current window but
another one, this command let to do that without switching windows
without ^Ww normal command.

Nice idea.  I would find ":1close" and ":9close" the most useful,
closing the first and last window.  Looks like the code does take the
last window when the count is more than the number of windows.  This
isn't obvious in the documentation, adding these two as an example will
make them found quicker.  And perhaps :hide docs should refer to the
explanation of [count] in :close.

How about a test?

Thinking about this, it would also be very nice to be able to close the
next or previous window:

        :+1close
        :-1close

And there is this entry in the todo list:

        Can't easily close the help window, like ":pc" closes the
        preview window and ":ccl" closes the quickfix window.  Add
        ":hclose". (Chris Gaal)
        Patch for :helpclose, Christian Brabandt, 2010 Sep 6.

Looks like I'm a bit behind including patches...

Here is the patch.  As a bonus:
     :$close " will close the last window
     :$-close " will close the penultimate window
     :.close  " the same as :close
     :%close, :/pattern/close, :*close, ... " will emit E16 error

There are probably a few other commands that could benefit with
a similar approach.

Best regards,
Marcin Szamotulski

Some people expect  :1,$bd  or :%bd  to delete all buffers.

--
Andy

--
--
You received this message from the "vim_dev" 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

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui