Saturday, February 27, 2010

Re: close file but not the tab

Jan,

Have you seen my 2nd question also?

When I close Vim with 1 or 2 open documents I would like to reopen
these documents open.

Is that possible?

On Feb 27, 10:51 am, Jan Larres <li...@majutsushi.net> wrote:
> rameo <rai...@gmail.com>:
>
> > I have read the help pieces you've mentioned but not found the answer
> > to my questions.
>
> > What do I have to do?
>
> Put this into your .vimrc:
>
> " delete buffer without closing window
> function! Bclose()
>     let l:currentBufNum = bufnr("%")
>     let l:alternateBufNum = bufnr("#")
>
>     if buflisted(l:alternateBufNum)
>         buffer #
>     else
>         bnext
>     endif
>
>     if bufnr("%") == l:currentBufNum
>         new
>     endif
>
>     if buflisted(l:currentBufNum)
>         execute("bdelete! ".l:currentBufNum)
>     endif
> endfunction
>
> and assign a mapping to it:
>
> nmap <F8> :call Bclose()<cr>
>
>         Jan
>
> --
> OpenPGP Key-ID: 00A0FD5F
> "Religion is regarded by the common people as true, by the wise as false,
> and by the rulers as useful."  -- Seneca

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