tabline: Allow an alternate style for bufferlist

fixes #1608
This commit is contained in:
Christian Brabandt 2018-01-04 15:45:36 +01:00
parent d78f686ce5
commit a25757ac64
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 21 additions and 8 deletions

View File

@ -118,9 +118,16 @@ endfunction
function! s:get_transitioned_seperator(self, prev_group, group, side)
let line = ''
call airline#highlighter#add_separator(a:prev_group, a:group, a:side)
let line .= '%#'.a:prev_group.'_to_'.a:group.'#'
let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep
let line .= '%#'.a:group.'#'
if get(a:self._context, 'tabline', 0) && get(g:, 'airline#extensions#tabline#alt_sep', 0) && a:group ==# 'airline_tabsel' && a:side
call airline#highlighter#add_separator(a:prev_group, a:group, 0)
let line .= '%#'.a:prev_group.'_to_'.a:group.'#'
let line .= a:self._context.right_sep.'%#'.a:group.'#'
else
call airline#highlighter#add_separator(a:prev_group, a:group, a:side)
let line .= '%#'.a:prev_group.'_to_'.a:group.'#'
let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep
let line .= '%#'.a:group.'#'
endif
return line
endfunction

View File

@ -659,12 +659,19 @@ are supported!
<
* enable/disable displaying buffers with a single tab. (c) >
let g:airline#extensions#tabline#show_buffers = 1
<
Note: If you are using neovim (has('tablineat') = 1), then you can click
on the tabline with the left mouse button to switch to that buffer, and
with the middle mouse button to delete that buffer.
* if you want to show the current active buffer like this:
----------------------
buffer <buffer> buffer `
>
let g:airline#extensions#tabline#alt_sep = 1
< Only makes sense, if g:airline_right_sep is not empty.
default: 0
* enable/disable displaying tabs, regardless of number. (c) >
let g:airline#extensions#tabline#show_tabs = 1
<
@ -684,7 +691,7 @@ with the middle mouse button to delete that buffer.
* enable/disable displaying tab type (far right) >
let g:airline#extensions#tabline#show_tab_type = 1
<
Note: The tab-type will only be displayed in tab-mode,
if there are no splits shown. (See: g:airline#extensions#tabline#show_splits)
@ -712,7 +719,7 @@ with the middle mouse button to delete that buffer.
nmap <leader>9 <Plug>AirlineSelectTab9
nmap <leader>- <Plug>AirlineSelectPrevTab
nmap <leader>+ <Plug>AirlineSelectNextTab
<
Note: Mappings will be ignored within "g:airline#extensions#tabline#keymap_ignored_filetypes".
Note: In buffer_idx_mode these mappings won't change the
@ -720,7 +727,7 @@ with the middle mouse button to delete that buffer.
Use |gt| for switching tabs.
In tabmode, those mappings will switch to the specified tab.
* define the set of filetypes which are ignored selectTab keymappings
* define the set of filetypes which are ignored selectTab keymappings >
let g:airline#extensions#tabline#keymap_ignored_filetypes = ['vimfiler', 'nerdtree']
* change the display format of the buffer index >
@ -821,7 +828,6 @@ Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
let airline#extensions#tabline#disable_refresh = 0
* preserve windows when closing a buffer from the bufferline (default: 0) >
let airline#extensions#tabline#middle_click_preserves_windows = 1
<
------------------------------------- *airline-tmuxline*