Skip to content

ipod825/taboverflow.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

taboverflow.vim

Screenshot

taboverflow.vim deals with the problem that the current tab becomes invisible in the tabline when there are too many tabs. Users can fully customize it by implementing a label function.

Installation


Using vim-plug

Plug 'ipod825/taboverflow.vim'

Customization


Implement g:TaboverflowLabel returning the string for each tab.

" This is the default implementation
function s:MyTabLabel(n)
    let buflist = tabpagebuflist(a:n)
    let winnr = tabpagewinnr(a:n)
    let res = '%#Visual#'.taboverflow#unicode_num(a:n)
    if a:n == tabpagenr()
        let res .= '%#TabLineSel#'
    else
        let res .= '%#TabLine#'
    endif
    let bufnr = buflist[winnr - 1]
    if getbufvar(bufnr, '&modified') == 1
        let res .= '*'
    endif
    let bufname = fnamemodify(bufname(bufnr), ':t')
    if empty(bufname)
        let bufname = '[No Name]'
    endif
    let res .= bufname
    return res
endfunction
let g:TaboverflowLabel = function('s:MyTabLabel')

" This mappings are for moving tabs arounbd.
nmap <c-m-h> <Plug>TabMovePrev
nmap <c-m-l> <Plug>TabMoveNext

Related


About

Too many tabs in vim? taboverflow comes in rescue!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors