vim-airline / vim-airline

lean & mean status/tabline for vim that's light as air
MIT License
17.79k stars 1.11k forks source link

Can't display tabline, extension is not loaded despite being enabled. #2548

Closed EnricoSteez closed 2 years ago

EnricoSteez commented 2 years ago

environment

if you are using terminal:
- terminal: iTerm2
- $TERM variable: xterm-256color
if you are using Neovim:
- does it happen in Vim: yes

#### actual behavior

Tabline is not showing under any circumstance. When I do `:AirlineExtensions`, tabline is `not loaded`.
I wonder whether I should "install it"? But I really don't understand how.
After reading `:help airline-extensions`, it says that "Most extensions are enabled by default and lazily loaded when the
corresponding plugin (if any) is detected.", even though from the docs it doesn't seem to me that I should instal any additional plugin for the tabline...

#### expected behavior

Tablines showing at the top of the screen

Here is my complete init.vim, maybe it could contain some plugins that are conflicting with the tabline extension.

" Options set clipboard=unnamedplus " Enables the clipboard between Vim/Neovim and other applications. set completeopt=noinsert,menuone,noselect " Modifies the auto-complete menu to behave more like an IDE. set relativenumber set cursorline " Highlights the current line in the editor set hidden " Hide unused buffers set autoindent " Indent a new line set inccommand=split " Show replacements in a split screen set mouse=a " Allow to use the mouse in the editor set number " Shows the line numbers set splitbelow splitright " Change the split screen behavior set title " Show file title set wildmenu " Show a more advance menu set cc= " Remove the vertical line for code style (very annoying) filetype plugin indent on " Allow auto-indenting depending on file type syntax on set spell " enable spell check (may need to download language package) set ttyfast " Speed up scrolling in Vim set scrolloff=8 let mapleader = "\"

"(Supposedly) Smart way to move between panes map map map map

call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged') Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'ryanoasis/vim-devicons' Plug 'scrooloose/nerdtree' Plug 'sheerun/vim-polyglot' Plug 'numToStr/Comment.nvim' Plug 'jiangmiao/auto-pairs' Plug 'kyazdani42/nvim-web-devicons', Plug 'tpope/vim-surround', Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'tpope/vim-fugitive', Plug 'psf/black', { 'branch': 'main' } Plug 'airblade/vim-rooter', Plug 'junegunn/fzf.vim', Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }, " Color Schemes Plug 'EdenEast/nightfox.nvim', Plug 'joshdick/onedark.vim', Plug 'morhetz/gruvbox' Plug 'doums/darcula', Plug 'gosukiwi/vim-atom-dark', Plug 'jnurmine/Zenburn', Plug 'drewtempelmeyer/palenight.vim', Plug 'mhartington/oceanic-next', Plug 'arcticicestudio/nord-vim', Plug 'jacoborus/tender.vim'

call plug#end()

lua require('Comment').setup()

colorscheme gruvbox

" set tabline " set showtabline=2 " ##### #### #### #### #### AIRLINE #### #### #### #### #### " let g:airline_extensions = ['branch','tabline'] let g:airline#extension#tabline#enable=1 " let g:airline#extensions#tabline#buffer_nr_show = 1 " let g:airline#extensions#tabline#show_tab_nr = 1 " let g:airline#extensions#tabline#tab_nr_type = 1 " tab number " let g:airline#extension#tabline#left_sep=' ' " let g:airline#extension#tabline#left_alt_sep='|' " let g:airline#extension#tabline#formatter='default' " let g:bargreybars_auto=0 " let g:airline_solorized_bg='dark' " let g:airline_powerline_fonts=1 " let g:airline_theme='gruvbox'

set hidden

" Some servers have issues with backup files, see #649. set nobackup set nowritebackup

" Give more space for displaying messages. set cmdheight=2

" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable " delays and poor user experience. set updatetime=300

" Don't pass messages to |ins-completion-menu|. set shortmess+=c

" Always show the signcolumn, otherwise it would shift the text each time " diagnostics appear/become resolved. if has("nvim-0.5.0") || has("patch-8.1.1564") " Recently vim can merge signcolumn and number column into one set signcolumn=number else set signcolumn=yes endif

" Use tab for trigger completion with characters ahead and navigate. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. inoremap \ pumvisible() ? "\" : \ CheckBackspace() ? "\" : \ coc#refresh() inoremap pumvisible() ? "\" : "\"

function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction

" ##### ##### ##### ##### ##### ##### COC-NVIM #### ###### ##### ### #### #### #### " Use to trigger completion. if has('nvim') inoremap coc#refresh() else inoremap <c-@> coc#refresh() endif

" Make auto-select the first completion item and notify coc.nvim to " format on enter, could be remapped by other vim plugin inoremap pumvisible() ? coc#_select_confirm() \: "\u\\=coc#on_enter()\"

" Use [g and ]g to navigate diagnostics " Use :CocDiagnostics to get all diagnostics of current buffer in location list. nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next)

" GoTo code navigation. nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references)

" Use K to show documentation in preview window. nnoremap K :call ShowDocumentation()

function! ShowDocumentation() if CocAction('hasProvider', 'hover') call CocActionAsync('doHover') else call feedkeys('K', 'in') endif endfunction

" Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync('highlight')

" Symbol renaming. nmap rn (coc-rename)

" Formatting selected code. NOT WORKING!! xmap F :call CocAction('format') nmap F :call CocAction('format')

" This sorcery is obscure to me augroup mygroup autocmd! " Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end

" Applying codeAction to the selected region. " Example: <leader>aap for current paragraph xmap a (coc-codeaction-selected) nmap a (coc-codeaction-selected)

" Remap keys for applying codeAction to the current buffer. nmap ac (coc-codeaction) " Apply AutoFix to problem on the current line. nmap qf (coc-fix-current)

" Run the Code Lens action on the current line. nmap cl (coc-codelens-action)

" Map function and class text objects " NOTE: Requires 'textDocument.documentSymbol' support from the language server. xmap if (coc-funcobj-i) omap if (coc-funcobj-i) xmap af (coc-funcobj-a) omap af (coc-funcobj-a) xmap ic (coc-classobj-i) omap ic (coc-classobj-i) xmap ac (coc-classobj-a) omap ac (coc-classobj-a)

" Remap and for scroll float windows/popups. if has('nvim-0.4.0') || has('patch-8.2.0750') nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" endif

" Use CTRL-S for selections ranges. " Requires 'textDocument/selectionRange' support of language server. nmap (coc-range-select) xmap (coc-range-select)

" Add :Format command to format current buffer. command! -nargs=0 Format :call CocActionAsync('format')

" Add :Fold command to fold current buffer. command! -nargs=? Fold :call CocAction('fold', )

" Add :OR command for organize imports of the current buffer. command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')

" Add (Neo)Vim's native statusline support. " NOTE: Please see :h coc-status for integrations with external plugins that " provide custom statusline: lightline.vim, vim-airline. set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}

" Mappings for CoCList " Show all diagnostics. nnoremap a :CocList diagnostics " Manage extensions. nnoremap e :CocList extensions " Show commands. nnoremap c :CocList commands " Find symbol of current document. nnoremap o :CocList outline " Search workspace symbols. nnoremap s :CocList -I symbols " Do default action for next item. nnoremap j :CocNext " Do default action for previous item. nnoremap k :CocPrev " Resume latest coc list. nnoremap p :CocListResume

" ###### ##### ##### ##### ##### NERDTree ##### ##### ##### ##### ##### let g:NERDTreeWinSize=35 nmap n :NERDTreeToggle let NERDTreeQuitOnOpen=1

" " ###### ##### ##### ##### ##### ###### FOLD #### ##### ##### ##### ##### set foldmethod=indent set foldminlines=4 set foldignore=

" ###### ##### ##### ##### ##### ###### FZF #### ##### ##### ##### ##### nmap f :Files

" ###### ##### ##### ##### ##### ###### vim-fugitive (GIT) #### ##### ##### ##### ##### " nnoremap ga :G add -A | :G commit -v -q " " ###### ##### ##### ##### ##### ###### EDIT init.vim BLAZINGLY FAST #### ##### ##### ##### #####
" Reloads vimrc after saving but keep cursor position if !exists('*ReloadVimrc') fun! ReloadVimrc() let save_cursor = getcurpos() source $MYVIMRC call setpos('.', save_cursor) endfun endif autocmd! BufWritePost $MYVIMRC call ReloadVimrc()

nnoremap i :e $MYVIMRC " " ###### ##### ##### ##### ##### ###### EDIT init.vim BLAZINGLY FAST #### ##### ##### ##### #####

chrisbra commented 2 years ago

I have no idea why it would be disabled in your config. According to here airline only 'airline#extensions#tabline#enabled' and if this is not set, it should be enabled.

I suggest to try with a minimum vimrc file (also, if you are using session files, check those) and grep under your vimrc config folder.

And sorry, I cannot dig through you custom vimrc and plugins.

EnricoSteez commented 2 years ago

@chrisbra I tried with a minimum vimrc without even involving Neovim, but the effect is the same. This is the minimal config in vimrc and you can clearly see that nothing is showing (I realised there was a typo in extension[s] but even after correcting it, nothing is showing)

Screenshot 2022-07-12 at 12 38 16

Could you please elaborate on what to do with session files? I am definitely not an expert and more on the dumb side :)

chrisbra commented 2 years ago

so you have :let g:airline#extensions#tabline#enabled=1 ?

How does your directory structure look like? What does :scriptnames give you?

EnricoSteez commented 2 years ago

so you have :let g:airline#extensions#tabline#enabled=1 ?

Yes

How does your directory structure look like?

Screenshot 2022-07-12 at 16 52 41

What does :scriptnames give you?

Among other lines, the following:

 15: ~/.local/share/nvim/plugged/vim-airline/plugin/airline.vim
 16: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/init.vim
 17: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/parts.vim
 18: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/formatter/short_path.vim
 19: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/util.vim
 20: ~/.local/share/nvim/plugged/vim-airline-themes/plugin/airline-themes.vim
 21: ~/.local/share/nvim/plugged/vim-devicons/plugin/webdevicons.vim
 22: ~/.local/share/nvim/plugged/vim-airline/autoload/airline.vim
...
 77: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions.vim
 78: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/quickfix.vim
 79: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/netrw.vim
 80: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/fzf.vim
 81: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/term.vim
 82: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/section.vim
 83: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/highlighter.vim
 84: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/hunks.vim
 85: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/branch.vim
 86: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim
 87: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/nvimlsp.vim
 88: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/coc.vim
 89: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim
 90: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/po.vim
 91: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/wordcount.vim
 92: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/keymap.vim
 93: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/searchcount.vim
 95: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/themes.vim
 96: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/builder.vim
 97: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/default.vim

No trace of tabline

EnricoSteez commented 2 years ago

But if I check in ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline, there is everything:

~/.local/share/nvim/plugged/vim-..line/autoload/airline/extensions/tabline
╰─❯ tree
.
├── autoshow.vim
├── buffers.vim
├── buflist.vim
├── builder.vim
├── ctrlspace.vim
├── formatters
│   ├── default.vim
│   ├── jsformatter.vim
│   ├── short_path.vim
│   ├── tabnr.vim
│   ├── unique_tail.vim
│   └── unique_tail_improved.vim
├── tabs.vim
├── tabws.vim
└── xtabline.vim
chrisbra commented 2 years ago

hm, any other plugins running? In your vim, what does :let g:airline#extensions#tabline#enabled output? Are you sure you cloned correctly? can you run git status in the checkout workspace (toplevel vim-airline project dir)?

chrisbra commented 2 years ago

you could also try to move your default configuration directory away and check with a blank config. And possibly also try to run fgrep -ilr 'airline#extensions#tabline#enabled' ~/.local/share/nvim/

EnricoSteez commented 2 years ago

In your vim, what does :let g:airline#extensions#tabline#enabled output?

g:airline#extensions#tabline#enabled #1

I haven't cloned anything by hand, I am using vim-plug to install the plugins

can you run git status in the checkout workspace (toplevel vim-airline project dir)?

If you mean ~/.local/share/nvim/plugged/vim-airline, then:

╰─❯ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Regarding the fgrep command,

❯ fgrep -ilr 'airline#extensions#tabline#enabled' ~/.local/share/nvim/
/Users/enrico/.local/share/nvim//plugged/vim-airline/t/extensions_tabline.vim
/Users/enrico/.local/share/nvim//plugged/vim-airline/README.md
/Users/enrico/.local/share/nvim//plugged/vim-airline/doc/airline.txt
/Users/enrico/.local/share/nvim//plugged/vim-airline/autoload/airline/extensions/tabline.vim
/Users/enrico/.local/share/nvim//plugged/vim-airline/autoload/airline/extensions.vim
/Users/enrico/.local/share/nvim//swap/%Users%enrico%Desktop%HybridDB%params.py.swp
/Users/enrico/.local/share/nvim//swap/%Users%enrico%.config%nvim%init.vim.swo
EnricoSteez commented 2 years ago

Well, I think I cannot go more minimalistic than the vimrc I posted earlier, there is literally nothing except for the plugin manager and the vim-airline plugin. And I'm using Vim, not neovim, with a completely clean config dir structure

chrisbra commented 2 years ago

I am confused. Are you using vim or neovim? Your path looks wrong for vim. Also you did not show the complete scriptnames output and it is not clear if other plugins are loaded by default.

Please try the following:

mv ~/.vim ~/.vim-backup
mkdir -p .vim/pack/mine/start && cd $_ && git clone 'https://github.com/vim-airline/vim-airline' && cat <<EOF >~/.vim/vimrc
set nocp
let g:airline#extensions#tabline#enabled=1
EOF
cd && vim

This looks for me like this: image

How does your vim look like? Does that get you the tabline? What version of vim are you using?

EnricoSteez commented 2 years ago

I am using NEOVIM. I said that I tried using vim with a minimal config to see whether the problem would persist, and it does. The complete scriptname output is the following:

scriptnames
  1: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/ftplugin.vim
  2: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/indent.vim
  3: ~/.config/nvim/init.vim
  4: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/filetype.lua
  5: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/filetype.vim
  6: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/syntax/syntax.vim
  7: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/syntax/synload.vim
  8: ~/.local/share/nvim/site/autoload/plug.vim
  9: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/ftoff.vim
 10: ~/.local/share/nvim/plugged/vim-polyglot/filetype.vim
 11: ~/.local/share/nvim/plugged/vim-polyglot/autoload/polyglot/init.vim
 12: ~/.local/share/nvim/plugged/vim-polyglot/ftdetect/polyglot.vim
 13: ~/.local/share/nvim/plugged/vim-fugitive/ftdetect/fugitive.vim
 14: ~/.local/share/nvim/plugged/gruvbox/colors/gruvbox.vim
 15: ~/.local/share/nvim/plugged/vim-airline/plugin/airline.vim
 16: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/init.vim
 17: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/parts.vim
 18: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/formatter/short_path.vim
 19: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/util.vim
 20: ~/.local/share/nvim/plugged/vim-airline-themes/plugin/airline-themes.vim
 21: ~/.local/share/nvim/plugged/vim-devicons/plugin/webdevicons.vim
 22: ~/.local/share/nvim/plugged/vim-airline/autoload/airline.vim
 23: ~/.local/share/nvim/plugged/nerdtree/plugin/NERD_tree.vim
 24: ~/.local/share/nvim/plugged/nerdtree/autoload/nerdtree.vim
25: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/path.vim
 26: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/menu_controller.vim
 27: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/menu_item.vim
 28: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/key_map.vim
 29: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/bookmark.vim
 30: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/tree_file_node.vim
 31: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/tree_dir_node.vim
 32: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/opener.vim
 33: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/creator.vim
 34: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/flag_set.vim
 35: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/nerdtree.vim
 36: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/ui.vim
 37: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/event.vim
 38: ~/.local/share/nvim/plugged/nerdtree/lib/nerdtree/notifier.vim
 39: ~/.local/share/nvim/plugged/nerdtree/autoload/nerdtree/ui_glue.vim
 40: ~/.local/share/nvim/plugged/vim-devicons/nerdtree_plugin/webdevicons.vim
 41: ~/.local/share/nvim/plugged/nerdtree/nerdtree_plugin/exec_menuitem.vim
 42: ~/.local/share/nvim/plugged/nerdtree/nerdtree_plugin/fs_menu.vim
 43: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/autoload/provider/clipboard.vim
 44: ~/.local/share/nvim/plugged/nerdtree/nerdtree_plugin/vcs.vim
 45: ~/.local/share/nvim/plugged/auto-pairs/plugin/auto-pairs.vim
 46: ~/.local/share/nvim/plugged/nvim-web-devicons/plugin/nvim-web-devicons.vim
 47: ~/.local/share/nvim/plugged/vim-surround/plugin/surround.vim
 48: ~/.local/share/nvim/plugged/coc.nvim/plugin/coc.vim
 49: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/rpc.vim
50: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/util.vim
 51: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/client.vim
 52: ~/.local/share/nvim/plugged/vim-fugitive/plugin/fugitive.vim
 53: ~/.local/share/nvim/plugged/black/plugin/black.vim
 54: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/autoload/provider/python3.vim
 55: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/autoload/provider/pythonx.vim
 56: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/autoload/remote/host.vim
 57: ~/.local/share/nvim/plugged/vim-rooter/plugin/rooter.vim
 58: ~/.local/share/nvim/plugged/fzf.vim/plugin/fzf.vim
 59: ~/.local/share/nvim/plugged/fzf/plugin/fzf.vim
 60: ~/.local/share/nvim/plugged/nightfox.nvim/plugin/nightfox.vim
 61: ~/.local/share/nvim/plugged/vim-polyglot/plugin/polyglot.vim
 62: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/gzip.vim
 63: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/health.vim
 64: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/man.vim
 65: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/matchit.vim
 66: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
 67: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/matchparen.vim
 68: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/netrwPlugin.vim
 69: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/rplugin.vim
 70: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/shada.vim
 71: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/spellfile.vim
 72: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/tarPlugin.vim
 73: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/tohtml.vim
 74: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/tutor.vim
75: /usr/local/Cellar/neovim/0.7.0/share/nvim/runtime/plugin/zipPlugin.vim
 76: ~/.local/share/nvim/plugged/Comment.nvim/after/plugin/Comment.lua
 77: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions.vim
 78: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/quickfix.vim
 79: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/netrw.vim
 80: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/fzf.vim
 81: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/term.vim
 82: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/section.vim
 83: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/highlighter.vim
 84: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/hunks.vim
 85: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/branch.vim
 86: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim
 87: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/nvimlsp.vim
 88: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/coc.vim
 89: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim
 90: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/po.vim
 91: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/wordcount.vim
 92: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline.vim
 93: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/autoshow.vim
 94: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/tabs.vim
 95: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim
 96: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/keymap.vim
 97: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/searchcount.vim
 98: ~/.local/share/nvim/plugged/gruvbox/autoload/airline/themes/gruvbox.vim
 99: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/themes.vim
100: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/builder.vim
101: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/default.vim
102: ~/.local/share/nvim/plugged/vim-polyglot/autoload/polyglot/sleuth.vim
103: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/ctrlspace.vim
104: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/tabws.vim
105: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim
106: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/buflist.vim
107: ~/.local/share/nvim/plugged/vim-devicons/autoload/airline/extensions/tabline/formatters/webdevi
cons.vim
108: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/default.
vim
109: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/compat.vim
110: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/highlight.vim
111: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/float.vim
112: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/cursor.vim
113: ~/.local/share/nvim/plugged/coc.nvim/autoload/coc/window.vim
chrisbra commented 2 years ago

92: ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline.vim

so tabline is loaded? So what does :verbose set tabline? showtabline? show? Also can you please try the experiment with a minmum vimrc as I have shown above?

EnricoSteez commented 2 years ago

I think we are getting there somehow. I think there is some "caching" issue or session files, as you were saying before. Because now after restarting Neovim, for some reason it is showing, but the look is weird. For instance, if I customise the looks in init.vim and source the file, it gets somehow applied. But then when I restart Neovim, it goes back to the previous state: the variables are correctly set in the init.vim file and in the environment, but the changes are not showing on screen. Let's say I start from this configuration (nothing customised, buffers showing at the top)

Screenshot 2022-07-12 at 22 53 33

If I enable these two options, for instance, and source the file, I can see some changes happening at the top (even though it's ugly and I don't think it should)

Screenshot 2022-07-12 at 22 54 02

But then when I quit and reopen you can see that the options are still active but the tabline is unchanged!

Screenshot 2022-07-12 at 22 55 31
EnricoSteez commented 2 years ago

So what does :verbose set tabline? showtabline? show?

 tabline=%!airline#extensions#tabline#get()
        Last set from ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline.vi
m line 79
  showtabline=2
        Last set from ~/.local/share/nvim/plugged/vim-airline/autoload/airline/extensions/tabline.vi
m line 164
chrisbra commented 2 years ago

okay, at least this looks fine. Now whatever you mean with caching, I have no idea. Are you using session files or view files? Perhaps you are storing the options there (which is not recommended) . I have also no idea why setting those variables would be cached after a restart.

EnricoSteez commented 2 years ago

I have no idea about caching either, it just feels like something is "cached" or, anyways, the tabline is not drawn according to init.vim but according to some previous state. I don't know what session/view files are, so I am not using any of this EXPLICITLY. I am just using init.vim as I am not a long time user

chrisbra commented 2 years ago

not sure. Apparently this depends on some other global variables like: g:airline_left_sep and g:airline_powerline_fonts being set

https://github.com/vim-airline/vim-airline/blob/83d853adc7f799b893acfc2e0df31bf59dd4c046/autoload/airline/extensions/tabline.vim#L234-L249

You can check what echo airline#extensions#tabline#get() outputs. If this doesn't help, I am afraid you need to manually step through those functions to debug them.

EnricoSteez commented 2 years ago

I think I finally managed to fix it, most of the problems actually fixed themselves when quitting and reopening vim since I noticed that sourcing init.vim breaks the looks of the tabline. I don't know if this behaviour is normal or not, but opening a fresh Neovim instance solves the issue and I can display the tabline correctly!

toxaO commented 1 year ago

Please allow me to add that I have experienced similar symptoms. The tabline was not enabled, but after moving the colorscheme setting after tabline#enabled, the tabline was enabled.

vim.g['airline#extensions#tabline#enabled']=1
vim.cmd[[colorscheme iceberg]] 
Praful commented 1 year ago

In case it helps someone else: I had a similar problem. A tab appeared when I enabled tabline but no further tabs appeared when I opened new files. I use the same vim config on my laptop and desktop. The tabline feature worked on the laptop but not desktop.

The problem was caused by the session file created by plugin xolox/vim-session. This saves and restores vim's state.

To fix the issue, I deleted ~/.vim/sessions/default.vim.