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'
This commit is contained in:
Emily St 2014-03-19 13:39:07 -07:00 committed by Emily Strickland
parent 799e5e028f
commit f196ea1f36
2 changed files with 13 additions and 2 deletions

View File

@ -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: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_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_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 = { let s:builder_context = {
\ 'active' : 1, \ 'active' : 1,
@ -264,8 +266,10 @@ function! s:get_tabs()
call b.add_raw('%T') call b.add_raw('%T')
call b.add_section('airline_tabfill', '') call b.add_section('airline_tabfill', '')
call b.split() call b.split()
call b.add_section('airline_tab', ' %999XX ') call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ')
call b.add_section('airline_tabtype', ' tabs ') if s:show_tab_type
call b.add_section('airline_tabtype', ' tabs ')
endif
let s:current_bufnr = curbuf let s:current_bufnr = curbuf
let s:current_tabnr = curtab let s:current_tabnr = curtab

View File

@ -382,6 +382,9 @@ eclim <https://eclim.org>
* enable/disable displaying tab number in tabs mode. > * enable/disable displaying tab number in tabs mode. >
let g:airline#extensions#tabline#show_tab_nr = 1 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. > * defines the name of a formatter for how buffer names are displayed. >
let g:airline#extensions#tabline#formatter = 'default' let g:airline#extensions#tabline#formatter = 'default'
@ -430,6 +433,10 @@ eclim <https://eclim.org>
let g:airline#extensions#tabline#left_alt_sep = '' let g:airline#extensions#tabline#left_alt_sep = ''
let g:airline#extensions#tabline#right_sep = '' let g:airline#extensions#tabline#right_sep = ''
let g:airline#extensions#tabline#right_alt_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'. Note: Enabling this extension will modify 'showtabline' and 'guioptions'.