Skip to content

Instantly share code, notes, and snippets.

@RobertDober
Created March 31, 2011 13:38
Show Gist options
  • Save RobertDober/896354 to your computer and use it in GitHub Desktop.
Save RobertDober/896354 to your computer and use it in GitHub Desktop.
How to set the tablabel in vim
"
" Guitablabels
"
let t:tablabel="<>"
function! GuiTabLabel()
if exists("t:tablabel")
return t:tablabel
else
return expand("%f")
" or do something more clever
return substitute( expand("%f"), '\([^/]\)[^/]*/', '\1../', "g" )
endif
endfunction
set guitablabel=%{GuiTabLabel()}
"
" application example:
"
function OpenTabWithLabel( path, label )
let t:tablabel=a:label
exe "tabnew " . a:path
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment