Hi there,

On Apr 10 2008, 12:12 pm, Bill  Mill <[email protected]> wrote:
> Simpler:
>
> function! MyLabel(n)
>   if exists('t:name')
>     return t:name
>   else
>     return ''
>   endif
> endfunction
>
> function! MyGuiTabLine()
>  let s = '%{MyLabel(' . tabpagenr() . ')}'
>  return s
> endfunction
>
> set guitablabel=%!MyGuiTabLine()
>
> -Bill

Even simpler:

function! MyLabel()
  if exists('t:name')
    return t:name
  else
    return ''
  endif
endfunction

set guitablabel=%{MyLabel()}

>
> On Apr 10, 12:38 pm, Bill  Mill <[email protected]> wrote:
>
> > On Apr 10, 11:46 am, Bem Jones-Bey <[email protected]> wrote:
>
> > > Bill Mill wrote:
>
> > > I don't know how to set a label just for a single tab, however, if you
> > > want to set a variable, you need to use let instead of set. (Set sets an
> > > option, and let sets a variable).
>
> > > Hope that helps.
>
> > Thanks - I'm a lot closer now. This mostly works, except it doesn't
> > change the tab name until you switch tabs:
>
> > function! MyLabel(n)
> >   if exists('t:name')
> >     return t:name
> >   else
> >     let buflist = tabpagebuflist(a:n)
> >     let winnr   = tabpagewinnr(a:n)
> >     let bufnam  = bufname(buflist[winnr - 1])
> >     " This is getting the basename() of bufname above
> >     let base    = substitute(bufnam, '.*/', '', '')
> >     return base
> >   endif
> > endfunction
>
> > function! MyGuiTabLine()
> >  let s = ' %{MyLabel(' . tabpagenr() . ')} '
> >  return s
> > endfunction
>
> > set guitablabel=%!MyGuiTabLine()
>
> > Is there any way to have the tab label refresh as soon as you "let
> > t:name="something""?
>
> > -Bill

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