From f196ea1f36cb906943643b1f1767ef58a433345e Mon Sep 17 00:00:00 2001 From: Emily St Date: Wed, 19 Mar 2014 13:39:07 -0700 Subject: [PATCH] Customizes tabline appearance: type, close button This commit adds a couple of new settings so that it's possible to hide the tab type (all the way to the right) and the symbol which represents the close button. The settings and their defaults: let g:airline#extensions#tabline#show_tab_type = 1 let g:airline#extensions#tabline#close_symbol = 'X' --- autoload/airline/extensions/tabline.vim | 8 ++++++-- doc/airline.txt | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/autoload/airline/extensions/tabline.vim b/autoload/airline/extensions/tabline.vim index 3c9dc1a..ec75db7 100644 --- a/autoload/airline/extensions/tabline.vim +++ b/autoload/airline/extensions/tabline.vim @@ -6,6 +6,8 @@ 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:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1) +let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1) +let s:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X') let s:builder_context = { \ 'active' : 1, @@ -264,8 +266,10 @@ function! s:get_tabs() call b.add_raw('%T') call b.add_section('airline_tabfill', '') call b.split() - call b.add_section('airline_tab', ' %999XX ') - call b.add_section('airline_tabtype', ' tabs ') + call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ') + if s:show_tab_type + call b.add_section('airline_tabtype', ' tabs ') + endif let s:current_bufnr = curbuf let s:current_tabnr = curtab diff --git a/doc/airline.txt b/doc/airline.txt index d5407b9..6e4ba99 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -382,6 +382,9 @@ eclim * enable/disable displaying tab number in tabs mode. > let g:airline#extensions#tabline#show_tab_nr = 1 +* enable/disable displaying tab type (far right) + let g:airline#extensions#tabline#show_tab_type = 1 + * defines the name of a formatter for how buffer names are displayed. > let g:airline#extensions#tabline#formatter = 'default' @@ -430,6 +433,10 @@ eclim let g:airline#extensions#tabline#left_alt_sep = '' let g:airline#extensions#tabline#right_sep = '' let g:airline#extensions#tabline#right_alt_sep = '' + +* configure symbol used to represent close button + let g:airline#extensions#tabline#close_symbol = 'X' + < Note: Enabling this extension will modify 'showtabline' and 'guioptions'.