From a9b2fd2c4181212bf252d1acf595fd9bb57751b0 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Wed, 4 Sep 2013 20:17:02 +0000 Subject: [PATCH] allow configuration for showing only tabs. resolves #220. --- autoload/airline/extensions/tabline.vim | 3 ++- doc/airline.txt | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 53d9a73..7eab630 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -4,6 +4,7 @@ let s:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':p:.') let s:excludes = get(g:, 'airline#extensions#tabline#excludes', []) let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0) +let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0) let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ') let s:buf_modified_symbol = g:airline_symbols.modified @@ -63,7 +64,7 @@ function! s:cursormove() endfunction function! airline#extensions#tabline#get() - if tabpagenr('$') == 1 + if s:show_buffers && tabpagenr('$') == 1 return s:get_buffers() else return s:get_tabs() diff --git a/doc/airline.txt b/doc/airline.txt index db39877..5101e46 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -296,6 +296,9 @@ virtualenv * enable/disable enhanced tabline. > let g:airline#extensions#tabline#enabled = 0 < +* enable/disable displaying buffers with a single tab. > + let g:airline#extensions#tabline#show_buffers = 1 +< * configure the formatting of filenames (see |filename-modifiers|). > let g:airline#extensions#tabline#fnamemod = ':p:.' <