lin q wrote:
Hi,
I am using VIM7 on cygwin on WinXP. If I use vim -p file1 file2 to open
my files, each tab has the file name, file1 and file2. This is right.
If I use "vim --remote-tab-silent file3" to open file3, then the tab of
file3 has some path crumpled before file3 something like,
\p\E\e\J\file3, it looks abbreviated path, it looks ugly.
Any way I can get rid of the path, only file name on the tab?
Yes, with a custom tabline. The following (from my vimrc) might inspire you to
write your own:
if exists("+guioptions")
set go-=e
endif
if exists("+showtabline")
function MyTabLine()
let s = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%1*' : '%2*')
let s .= ' '
let s .= i . ':'
let s .= winnr . '/' . tabpagewinnr(i,'$')
let s .= ' %*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let file = bufname(buflist[winnr - 1])
let file = fnamemodify(file, ':p:t')
if file == ''
let file = '[No Name]'
endif
let s .= file
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set stal=2
set tabline=%!MyTabLine()
map <F12> :tabnext<CR>
map! <F12> <C-O>:tabnext<CR>
map <S-F12> :tabprev<CR>
map! <S-F12> <C-O>:tabprev<CR>
endif
Best regards,
Tony.
--
Fortune's Real-Life Courtroom Quote #18:
Q: Are you married?
A: No, I'm divorced.
Q: And what did your husband do before you divorced him?
A: A lot of things I didn't know about.