Friday, July 2, 2010

Re: scratch buffer on start up

On Jun 3, 1:54 am, Tinou <tinou...@gmail.com> wrote:
> Now this seems to work:
>
> autocmd! BufNew * if empty(expand("<afile>")) | call
> setbufvar(bufnr("$"), "&buftype", "nofile") | endif
>
> I'm not very happy with the bufnr("$"), but bufnr("<afile>") returns
> -1. Can I rely, in this case for the <afile> to always be the last
> buffer ? Or is there a better way to get the number of the <afile>
> buffer ?

Maybe try bufnr(expand("<afile>"))

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