On Thu, Mar 24, 2011 at 4:07 AM, Caesarmv <[email protected]> wrote:

> This is my first message. Can you see me?

Yes.

> My question is: how to close all unvisible buffers?
> For example: I have 5 tabs opened (5 visible buffers) and many unvisible
> buffers (I am seeing with :ls command).

You could define a function like the following:

function! CloseHiddenBuffers()
        let lastBuffer = bufnr('$')
        let currentBuffer = 1
        while currentBuffer <= lastBuffer
                if bufexists(currentBuffer) && buflisted(currentBuffer) &&
bufwinnr(currentBuffer) < 0
                        execute 'bdelete' currentBuffer
                endif
                let currentBuffer = currentBuffer + 1
        endwhile
endfunction

.. and map that to a useful key sequence.

-- 
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

Reply via email to