Created
March 31, 2011 13:38
-
-
Save RobertDober/896354 to your computer and use it in GitHub Desktop.
How to set the tablabel in vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
" 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