Vim-airline: How ot disable buffers in tabline

Created on 21 Feb 2016  路  46Comments  路  Source: vim-airline/vim-airline

Hi.

I am preferring to work with tabs instead of buffers. How to disable displaying buffers and tabs together in tabline?

My config:

let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#show_tabs = 1

Most helpful comment

I know what is buffers.

Then be precise in what you say and don't make yourself sound, as you don't know.

Please, respect other users and their opinions.

I'll do, if feedback is respectful and constructive. Your attitude isn't helping much.

All 46 comments

Does that work?
let g:airline#extensions#tabline#enabled = 0

Are you kidding?
I don't want to disable tabline completely.

Please be kind. I don't see the problem, if the tabline additionally also displays the buffers.

I am kind ;-)
This is a big problem. Try to open 10 files. Tabline has limited space, what the sense to waste space for useless info? Many peoples, not only me, don't use buffers at all. Second reason - right tabs position, this is completely differs from all other software (browsers, etc...). New era in design of interfaces? ;-)

First of all, you are always using buffers in Vim. Second of all, I like the new design, but if you don't, I guess, we can restore the old behaviour. This will take a while for me, so feel free to open a PR.

Listen, I am using vim about 10 years. I know what is buffers.
Airline - is not a plugin for displaying buffers list.
Why I should make PR? I don't have time for this now.
If you make some significant changes to the public software - you should make this features optional.
I already contributed to airline in the past, and my changes was fully customizable.
Please, respect other users and their opinions.

I know what is buffers.

Then be precise in what you say and don't make yourself sound, as you don't know.

Please, respect other users and their opinions.

I'll do, if feedback is respectful and constructive. Your attitude isn't helping much.

At the risk of inflaming this conversation, I would also like to request a way to revert to the old layout and behavior of the tabline. Having the tabline list on the far right of the screen is very off-putting, and grinds against the way that the UI in vim and most other programs conventionally lays out tabs. Moreover, having the live bufferline in place on the left isn't helpful for me, as when I am using tabs I tend not to bury buffers. And, when I work with hidden buffers, I don't use tabs, etc. etc.

I really appreciate the work that as been put into airline, and I understand that regressing this feature is a hassle. However, it is hugely disruptive for me and (it looks like) others.

You are really don't see the problem here?

  1. Right tab position is not intuitive. Why right? Let's place tabs list in the center of the screen, maybe somebody will like this;
  2. What I should do, if I don't need to see buffers list all time or I don't need buffers list at all, because I am not using buffers - based navigation? Remove airline?
  3. Why you are impose your design experiments to others?
  4. All community (including me) are appreciate your work, but please, make this feature switchable;

i half-expected a reaction like this, which is why i merged it on the weekend :wink:

there's an easy fix here -- just flip the UI; show the tabs on the left and show the splits on the right.

once we do that, the remaining question is whether the right side should default to the label "tabs", as it was before, or default to showing the splits in the tab.

please try the latest commit and see if it's acceptable. if you find that the default behavior with the splits on the right is too intrusive i'll flip switch and make the default false.

Looks great, thanks for the quick fix! I went ahead and disabled the splits pane on the right by adding this into my config:

let g:airline#extensions#tabline#show_splits = 0

*Edit -- a couple of other thoughts on this change:

  • It looks like having airline automatically set guioptions-=e and then force the tabline to stay visible is causing some issues in my MacVim. In the past, I had manually set go=e and had showtabline=1 set too. The new airline rev was forcing the gui tab to appear, regardless, which looked crazy. I've sorted the problem by setting let g:airline#extensions#tabline#enabled = 0 in my gui-specfic config, but it took a bit of digging to sort out what was going on.
  • Similarly, I'm not sure how to disable the airline tabline extension in windows where only a single tab is open. The old setting was g:airline#extensions#tabline#tab_min_count, but that doesn't seem to work any longer.

let g:airline#extensions#tabline#show_splits = 0

This option is missing in help.

Some themes were broken after #952. More details at #1046 and vim-airline/vim-airline-themes#16.

Hi,
Will take care of the missing documentation.

It looks like having airline automatically set guioptions-=e and then force
the tabline to stay visible is causing some issues in my MacVim. In the
past, I had manually set go=e and had showtabline=1 set too. The new
airline rev was forcing the gui tab to appear, regardless, which looked
crazy. I've sorted the problem by setting let
g:airline#extensions#tabline#enabled = 0 in my gui-specfic config, but it
took a bit of digging to sort out what was going on.

What do you suggest?

Similarly, I'm not sure how to disable the airline tabline extension in
windows where only a single tab is open. The old setting was
g:airline#extensions#tabline#tab_min_count, but that doesn't seem to work
any longer.

Will look into this.

What do you suggest?

Well, I can see a couple of options. Ideally, whether to have the console-style tabline would be a configurable item, and airline wouldn't by default force instances of gvim to use console-style tabs. (This is a recent change I think? The overall behavior is certainly new, though maybe something else is causing it.) I understand that is a hassle, though, so the lowest-effort fix would be to clearly document what is happening and how to adjust it (e.g., similar to my fix above) in the help doc. I looked through the help and didn't see anything, and only found the solution for my problem after trolling through the recent commit diffs.

Will look into this.

Thanks!

@maccius the console style tabs in GUI has been there since the beginning because the it wouldn't work otherwise. the fact that you're seeing weird things now is more likely due to recent gvim changes.

as for documenting the switch, that can certainly be done (and why this issue is still open). however, i was hoping for more yes vs no feedback from "tab only" users on the default value before we close this out.

@bling Thanks, I didn't realize. I will say that I only had an issue in gvim after the #952 merge, and as I said above, adjusting some of the new variables sorted the issue out. I haven't updated my MacVim for a few weeks, which is why I assumed it was a change to airline.

I've sorted it regardless, and thanks for responding to the right/left UI so quickly!

Sorry, I seem to be confused. I just updated to the latest airline, but I'm not seeing the combined tab/buffer bar, is this still being figured out? I can't see any docs on how to use it.

I'm glad this got added though! I've been looking forward to it!

@ChrisPenner It should just work. Do you have tabs open?

Update:
1) Fixed the documentation about show_splits
2) @maccius I think, you also need let airline#extensions#tabline#show_buffers = 0 or else the tab_min_count setting won't work.
Can you please verify?

@chrisbra Thanks! That worked perfectly. I'd actually had that in my .vimrc, but had commented it out and forgot to re-enable it when I was fooling around with the new splits framework. D'oh. I appreciate the help in sorting this out!

Hrmm, thanks for taking a moment @chrisbra, I'm on commit 7418df5 but it still doesn't show up.

Here's with no tabs:
screen shot 2016-02-23 at 5 16 50 pm

Here's with 2 tabs:
screen shot 2016-02-23 at 5 17 20 pm

Here are my settings, is there something silly that I'm missing?

" Use patched fonts
let g:airline_powerline_fonts = 1

" Enable the list of buffers
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 1
let g:airline#extensions#tabline#show_tabs = 1

" Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'

" enable/disable fugitive/lawrencium integration
let g:airline#extensions#branch#enabled = 1

" enable/disable showing a summary of changed hunks under source control.
let g:airline#extensions#hunks#enabled = 1

" enable/disable showing only non-zero hunks.
let g:airline#extensions#hunks#non_zero_only = 1

let g:airline#extensions#whitespace#enabled = 0

first, i like airline but frankly speaking i liked it more in the past w/o showing buffers. i absolutely agree with @zdm. showing buffers in the tab line is a feature killer for me (i am using exclusively vim more than 15 years). it wastes a space and it is confusing in case you have more tabs. i have not found a way how to disable it yet (using gentoo, vim-7.4.1342). please give us a choice to decide if we want/don't want to use that. thank you.

@rpolasek please read the issue you are responding to. It has been fixed

@ChrisPenner That looks correct. Look at your second screenshot. At the left you see the tabs highlighted, at the right, the opened buffers in that tab.

I think this issue can be closed now.

@chrisbra i do but buffers still show :-( i am able to disable it only with let g:airline#extensions#tabline#enabled = 0 but i want to use tabline so it is not a solution for me. please, tell me what should i set to show only tabs on the left (old behaviour) and not buffers on the left and tabs on the right. thank you.

@rpolasek you should use

let g:airline#extensions#tabline#show_splits = 0

i use it but it doesn't have the effect i expect :-/
has been merged that fix to the master branch (which i use) yet or not?

yes, fix was merged.

  1. update airline to the latest revision;
  2. my settings:
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#show_splits = 0
let g:airline#extensions#tabline#show_tabs = 1
let g:airline#extensions#tabline#show_tab_nr = 0
let g:airline#extensions#tabline#show_tab_type = 0
let g:airline#extensions#tabline#close_symbol = '脳'
let g:airline#extensions#tabline#show_close_button = 0

i have just removed all my airline settings and pasted yours but there are still buffers on the left and tabs on the right, see a screenshot here: https://www.dropbox.com/s/8sfaf2sd6kn8ftw/screenshot.jpg?dl=0

this is last git log i can see in the airline git repo on my pc:

commit 7418df5583ff83056510cb5bfec2475c8cb68c49
Merge: adbfda4 67594b4
Author: Christian Brabandt [email protected]
Date: Tue Feb 23 21:41:17 2016 +0100

Merge pull request #1052 from chrisbra/doc

document airline#extensions#tabline#show_splits

Hmm. I don't know, what is the problem.
I have tabs on the left and buffers are not displayed.
You can try to remove .viminfo.

.viminfo removed but the issue still persists

Are you sure, that you have the latest revision?

$ git describe --tags
v0.7-288-g7418df5

correct?

~/.vim/bundle/airline $ git describe --tags
v0.7-288-g7418df5

Hmm, sorry, I don't know, what's the reason.
We have identical settings.
It should work.

Can you try with a new empty profile?

i think ctrlspace could be the culprint why it doesn't work for me
https://github.com/szw/vim-ctrlspace.git

[UPDATED]
updated: i am now absolutely sure it is ctrlspace. when i move it away from my ~/.vim/bundle/ everything works with my default .vimrc as i expect. could anybody confirm that, please?

I tried your airline config.
It works for me as expected.
Maybe the problem in your plugins.

now it is a question who could fix it - a maintainer of ctrlspace or airline? btw. thank you @chrisbra and @zdm for your help with investigation of my problem and for your patience :-)

ping @sappo Perhaps he knows a solution?

@rpolasek the ctrlspace integration into the tabline is completely independent and currently not very configurable. You can change the buffers and tabs label to safe some space but that's it. A quick fix maybe to add a switch to disable ctrlspace tabline and fallback to default airline tabline. Which should work fine if you only use tabs but behaves miserable at showing ctrlspace buffers.

@sappo thanks for you message. it seems i will have to find ctrlspace replacement...

@rpolasek from this thread I'm not sure what your exact problem is? Could you please open a new issue and describe it. Thanks!

@bling If you're still looking for feedback, I like the old behavior as the default. While I've been playing with the new style for the last few minutes, I've begun to appreciate it more, but it was a bit jarring when it first showed up as the default. I had recently turned off ctrlspace to remove this behavior and spent time trying to figure out why it was happening again.

The setting name to turn it off was a little unclear and it sounded similar to the buffer_nr_show setting. Maybe something like g:airline#extensions#tabline#show_splits_on_right or g:airline#extensions#tabline#show_splits_on_tabline would be clearer. If people were upset with the change though, maybe it's not a good idea to change that now unless you were making the default the old style.

As I said, I'm beginning to like it more over the last few minutes but there is one thing missing. When showing buffers only on the tabline, the current active buffer was always made visible. I have an old change to support the same behavior on the tabline but never got around to submitting a PR for it. With the new behavior of having both tabs and buffers on display, it could run out of room quicker and this behavior might help. It doesn't seem to keep the active buffer visible now with the new view. Should I create a new issue for this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ypxu picture ypxu  路  29Comments

liuchengxu picture liuchengxu  路  16Comments

notpratheek picture notpratheek  路  18Comments

c10b10 picture c10b10  路  29Comments

IngoMeyer441 picture IngoMeyer441  路  31Comments