mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 09:22:53 +08:00
Problem: Cannot disable tabs for ctrlspace tabline
Solution: Implement the show_tabs option which is used by the default tabline.
This commit is contained in:
parent
2f2797becb
commit
ab948735be
|
@ -11,6 +11,7 @@ let s:buffers_label = get(g:, 'airline#extensions#tabline#buffers_label', 'buffe
|
|||
let s:tabs_label = get(g:, 'airline#extensions#tabline#tabs_label', 'tabs')
|
||||
let s:switch_buffers_and_tabs = get(g:, 'airline#extensions#tabline#switch_buffers_and_tabs', 0)
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1)
|
||||
|
||||
function! airline#extensions#tabline#ctrlspace#off()
|
||||
augroup airline_tabline_ctrlspace
|
||||
|
@ -105,6 +106,8 @@ function! airline#extensions#tabline#ctrlspace#get()
|
|||
" Add left tabline content
|
||||
if s:show_buffers == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 0)
|
||||
elseif s:show_tabs == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, 0)
|
||||
else
|
||||
if s:switch_buffers_and_tabs == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
|
@ -122,6 +125,8 @@ function! airline#extensions#tabline#ctrlspace#get()
|
|||
" Add right tabline content
|
||||
if s:show_buffers == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:tabs_label)
|
||||
elseif s:show_tabs == 0
|
||||
call builder.add_section_spaced('airline_tabtype', s:buffers_label)
|
||||
else
|
||||
if s:switch_buffers_and_tabs == 0
|
||||
call airline#extensions#tabline#ctrlspace#add_tab_section(builder, 1)
|
||||
|
|
|
@ -489,16 +489,22 @@ eclim <https://eclim.org>
|
|||
let g:airline#extensions#whitespace#trailing_regexp = '\s$'
|
||||
<
|
||||
------------------------------------- *airline-tabline*
|
||||
* enable/disable enhanced tabline. >
|
||||
Note: If you're using the ctrlspace tabline only the option marked with (c)
|
||||
are supported!
|
||||
|
||||
* enable/disable enhanced tabline. (c)
|
||||
let g:airline#extensions#tabline#enabled = 0
|
||||
<
|
||||
|
||||
* enable/disable displaying open splits per tab (only when tabs are opened). >
|
||||
let g:airline#extensions#tabline#show_splits = 1
|
||||
<
|
||||
* enable/disable displaying buffers with a single tab. >
|
||||
*
|
||||
* switch position of buffers and tabs on splited tabline (c)
|
||||
let g:airline#extensions#tabline#switch_buffers_and_tabs = 0
|
||||
|
||||
* enable/disable displaying buffers with a single tab. (c)
|
||||
let g:airline#extensions#tabline#show_buffers = 1
|
||||
<
|
||||
* enable/disable displaying tabs, regardless of number. >
|
||||
* enable/disable displaying tabs, regardless of number. (c)
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
<
|
||||
* configure filename match rules to exclude from the tabline. >
|
||||
|
@ -518,18 +524,14 @@ eclim <https://eclim.org>
|
|||
* enable/disable displaying tab type (far right) >
|
||||
let g:airline#extensions#tabline#show_tab_type = 1
|
||||
|
||||
* enable/disable displaying index of the buffer.
|
||||
|
||||
Note: If you're using ctrlspace the tabline shows your tabs on the right and
|
||||
buffer on the left. Also none of the above tabline switches is currently
|
||||
supported!
|
||||
|
||||
* rename label for buffers (default: 'buffers') >
|
||||
* rename label for buffers (default: 'buffers') (c)
|
||||
let g:airline#extensions#tabline#buffers_label = 'b'
|
||||
|
||||
* rename label for tabs (default: 'tabs') >
|
||||
* rename label for tabs (default: 'tabs') (c)
|
||||
let g:airline#extensions#tabline#tabs_label = 't'
|
||||
<
|
||||
|
||||
* enable/disable displaying index of the buffer.
|
||||
|
||||
When enabled, numbers will be displayed in the tabline and mappings will be
|
||||
exposed to allow you to select a buffer directly. Up to 9 mappings will be
|
||||
exposed. >
|
||||
|
@ -554,7 +556,7 @@ eclim <https://eclim.org>
|
|||
Use |gt| for switching tabs.
|
||||
In tabmode, those mappings will switch to the specified tab.
|
||||
|
||||
* defines the name of a formatter for how buffer names are displayed. >
|
||||
* defines the name of a formatter for how buffer names are displayed. (c)
|
||||
let g:airline#extensions#tabline#formatter = 'default'
|
||||
|
||||
" here is how you can define a 'foo' formatter:
|
||||
|
@ -623,7 +625,6 @@ eclim <https://eclim.org>
|
|||
let airline#extensions#tabline#ignore_bufadd_pat =
|
||||
\ '\c\vgundo|undotree|vimfiler|tagbar|nerd_tree'
|
||||
|
||||
<
|
||||
Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
|
||||
|
||||
* enable Refresh of tabline buffers on |BufAdd| autocommands
|
||||
|
|
Loading…
Reference in New Issue
Block a user