cut off complete file path of tabnames

瀏覽次數:55 次
跳到第一則未讀訊息

molecula21

未讀,
2009年2月11日 中午12:51:112009/2/11
收件者:vim_use
I work in a lot of different directories and i'm used to have a lot of
tabs on my vim/gvim (latest version Linux). it happens that the full
path of the current buffer being edited apears as the title of the
tab. If the path is too long it turns out very dificult to navigate
through tabs...

Is there any way to tell vim to just display the name of the file and
not the full path?

Thanks

Oleksandr Manzyuk

未讀,
2009年2月11日 下午1:14:432009/2/11
收件者:vim...@googlegroups.com
I used to have

:set guitablabel=%t

in my .vimrc, which puts the file name in the label (works in gvim only).

Regards,
Oleksandr

>
> Thanks
> >
>

molecula21

未讀,
2009年2月11日 下午1:21:422009/2/11
收件者:vim_use
Works fine on gvim! tks! Anyone does know the solution for vim?

On Feb 11, 6:14 pm, Oleksandr Manzyuk <manz...@googlemail.com> wrote:

Roberto Miura Honji

未讀,
2009年2月12日 清晨6:54:162009/2/12
收件者:vim...@googlegroups.com
Try look in help setting-tabline.
With this, you can have so much type of configuration for your tab label.

2009/2/11 molecula21 <ruim...@gmail.com>



--
----------------------------------------------
Roberto Miura Honji
LAS - Laboratório de Administração e Segurança de Sistemas
Engenharia de Computação - 2006
Instituto de Computação - UNICAMP

email: miura...@gmail.com (principal)
email: ra06...@students.ic.unicamp.br
msn:   miura...@msn.com
-------------------------------------------

Tony Mechelynck

未讀,
2009年2月13日 凌晨12:28:352009/2/13
收件者:vim...@googlegroups.com
On 12/02/09 12:54, Roberto Miura Honji wrote:
> Try look in help setting-tabline.
> With this, you can have so much type of configuration for your tab label.

In Console Vim, or in gvim with the "e" flag not present in
'guioptions', you can define a custom 'tabline' which must take care of
all tabs, not just the current one. There's an example of custom tabline
at |setting-tabline|, here's another one:

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 <F10> :tabnext<CR>
map! <F10> <C-O>:tabnext<CR>
map <S-F10> :tabprev<CR>
map! <S-F10> <C-O>:tabprev<CR>
endif


The lines between the endfunction and the last endif are optional
(except of course the ":set tabline" command).


Best regards,
Tony.
--
There is no right or wrong, there is only your personal opinion.
(Bram Moolenaar)

回覆所有人
回覆作者
轉寄
0 則新訊息