itchyny / lightline.vim

A light and configurable statusline/tabline plugin for Vim
MIT License
6.75k stars 315 forks source link

Lightline doesn't seem to be auto enabled #150

Closed engelju closed 8 years ago

engelju commented 8 years ago

When I start a new vim instance, the statusbar stays the default and only changes into lightline after I open another file or call lightline#enable() immediatly after starting the vim session.

I have laststatus=2 set. :scriptnames/startuptime output

000.006  000.006: --- VIM STARTING ---
000.066  000.060: Allocated generic buffers
000.504  000.438: locale set
000.520  000.016: GUI prepared
000.523  000.003: clipboard setup
000.529  000.006: window checked
000.964  000.435: inits 1
000.976  000.012: parsing arguments
004.890  003.914: expanding arguments
008.254  003.364: shell init
008.659  000.405: Termcap init
008.698  000.039: inits 2
012.107  003.409: init highlight
012.455  000.210  000.210: sourcing $VIM/vimrc
012.825  000.060  000.060: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/ftoff.vim
013.514  000.486  000.486: sourcing /Users/julieengel/.vim/bundle/Vundle.vim/autoload/vundle.vim
014.025  000.210  000.210: sourcing /Users/julieengel/.vim/bundle/Vundle.vim/autoload/vundle/config.vim
039.401  000.052  000.052: sourcing /Users/julieengel/.vim/bundle/ultisnips/ftdetect/snippets.vim
039.487  000.057  000.057: sourcing /Users/julieengel/.vim/bundle/ultisnips/ftdetect/UltiSnips.vim
039.669  000.081  000.081: sourcing /Users/julieengel/.vim/bundle/vim-quicktask/ftdetect/quicktask.vim
039.871  000.137  000.137: sourcing /Users/julieengel/.vim/bundle/vim-markdown/ftdetect/markdown.vim
040.272  020.948  020.621: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
040.611  000.048  000.048: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/ftplugin.vim
040.928  000.044  000.044: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim
041.972  000.272  000.272: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
042.174  000.662  000.390: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
042.205  000.887  000.225: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
042.382  000.013  000.013: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
042.680  000.016  000.016: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/ftplugin.vim
042.934  000.011  000.011: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim
043.962  000.244  000.244: sourcing /opt/homebrew-cask/Caskroom/macvim/7.4-74/MacVim-snapshot-74/MacVim.app/Contents/Resources/vim/runtime/syntax/nosyntax.vim
044.487  000.164  000.164: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
044.712  000.574  000.410: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
044.753  001.164  000.346: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
045.338  000.272  000.272: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
046.009  000.207  000.207: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
046.269  000.758  000.551: sourcing /Users/julieengel/.vim/colors/jeng-256.vim
046.281  033.740  008.823: sourcing $HOME/.vimrc
046.285  000.228: sourcing vimrc file(s)
046.572  000.138  000.138: sourcing /Users/julieengel/.vim/bundle/lightline.vim/plugin/lightline.vim
047.373  000.686  000.686: sourcing /Users/julieengel/.vim/bundle/vim-surround/plugin/surround.vim
047.719  000.224  000.224: sourcing /Users/julieengel/.vim/bundle/vim-commentary/plugin/commentary.vim
047.963  000.153  000.153: sourcing /Users/julieengel/.vim/bundle/emmet-vim/plugin/emmet.vim
049.255  001.199  001.199: sourcing /Users/julieengel/.vim/bundle/vim-bufkill/plugin/bufkill.vim
050.574  001.219  001.219: sourcing /Users/julieengel/.vim/bundle/vim-autoclose/plugin/AutoClose.vim
050.834  000.018  000.018: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc.vim
051.161  000.200  000.200: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/os.vim
057.232  000.123  000.123: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/timer.vim
058.465  000.165  000.165: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/option.vim
059.153  002.188  001.900: sourcing /Users/julieengel/.vim/bundle/vim-easytags/autoload/xolox/easytags.vim
059.583  000.243  000.243: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/path.vim
068.234  000.060  000.060: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/list.vim
068.493  000.110  000.110: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/msg.vim
069.280  000.061  000.061: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/escape.vim
094.878  000.073  000.073: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/version.vim
095.932  000.123  000.123: sourcing /Users/julieengel/.vim/bundle/vim-misc/autoload/xolox/misc/cursorhold.vim
096.002  045.319  042.243: sourcing /Users/julieengel/.vim/bundle/vim-easytags/plugin/easytags.vim
096.773  000.148  000.148: sourcing /Users/julieengel/.vim/bundle/nerdtree/autoload/nerdtree.vim
098.026  000.515  000.515: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/path.vim
098.316  000.193  000.193: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/menu_controller.vim
098.539  000.101  000.101: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/menu_item.vim
098.769  000.129  000.129: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/key_map.vim
099.175  000.255  000.255: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/bookmark.vim
099.714  000.423  000.423: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/tree_file_node.vim
100.441  000.512  000.512: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/tree_dir_node.vim
100.787  000.238  000.238: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/opener.vim
101.138  000.260  000.260: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/creator.vim
101.280  000.053  000.053: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/flag_set.vim
101.510  000.142  000.142: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/nerdtree.vim
102.029  000.435  000.435: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/ui.vim
102.181  000.034  000.034: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/event.vim
102.332  000.052  000.052: sourcing /Users/julieengel/.vim/bundle/nerdtree/lib/nerdtree/notifier.vim
102.961  000.513  000.513: sourcing /Users/julieengel/.vim/bundle/nerdtree/autoload/nerdtree/ui_glue.vim
118.114  000.111  000.111: sourcing /Users/julieengel/.vim/bundle/nerdtree/nerdtree_plugin/exec_menuitem.vim
118.704  000.558  000.558: sourcing /Users/julieengel/.vim/bundle/nerdtree/nerdtree_plugin/fs_menu.vim
119.233  023.093  018.421: sourcing /Users/julieengel/.vim/bundle/nerdtree/plugin/NERD_tree.vim
119.930  000.105  000.105: sourcing /Users/julieengel/.vim/bundle/ultisnips/autoload/UltiSnips/map_keys.vim
120.054  000.667  000.562: sourcing /Users/julieengel/.vim/bundle/ultisnips/plugin/UltiSnips.vim
120.215  000.051  000.051: sourcing /Users/julieengel/.vim/bundle/vim-snippets/plugin/vimsnippets.vim
120.854  000.292  000.292: sourcing /Users/julieengel/.vim/bundle/ctrlp.vim/autoload/ctrlp/mrufiles.vim
121.033  000.724  000.432: sourcing /Users/julieengel/.vim/bundle/ctrlp.vim/plugin/ctrlp.vim
121.200  000.043  000.043: sourcing /Users/julieengel/.vim/bundle/vim-misc/plugin/xolox/misc.vim
123.256  001.809  001.809: sourcing /Users/julieengel/.vim/bundle/vim-notes/autoload/xolox/notes.vim
124.727  003.440  001.631: sourcing /Users/julieengel/.vim/bundle/vim-notes/plugin/notes.vim
124.960  000.105  000.105: sourcing /Users/julieengel/.vim/bundle/vim-quicktask/plugin/quicktask.vim
125.390  000.276  000.276: sourcing /Users/julieengel/.vim/bundle/vim-buftabs/plugin/buftabs.vim
125.982  000.103  000.103: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/getscriptPlugin.vim
126.317  000.278  000.278: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/gzip.vim
126.555  000.205  000.205: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/matchparen.vim
127.262  000.675  000.675: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/netrwPlugin.vim
127.636  000.216  000.216: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/rrhelper.vim
127.727  000.046  000.046: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/spellfile.vim
128.125  000.358  000.358: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tarPlugin.vim
128.318  000.129  000.129: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tohtml.vim
128.525  000.161  000.161: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
128.812  000.228  000.228: sourcing /Users/julieengel/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/zipPlugin.vim
129.272  000.136  000.136: sourcing /Users/julieengel/.vim/bundle/ultisnips/after/plugin/UltiSnips_after.vim
129.381  003.224: loading plugins
129.390  000.009: inits 3
131.538  002.148: reading viminfo
131.569  000.031: setting raw mode
131.576  000.007: start termcap
131.645  000.069: clearing screen
132.639  000.781  000.781: sourcing /Users/julieengel/.vim/bundle/lightline.vim/autoload/lightline.vim
133.232  000.145  000.145: sourcing /Users/julieengel/.vim/bundle/lightline.vim/autoload/lightline/tab.vim
134.064  000.324  000.324: sourcing /Users/julieengel/.vim/bundle/lightline.vim/autoload/lightline/colorscheme.vim
136.227  002.726  002.402: sourcing /Users/julieengel/.vim/bundle/lightline.vim/autoload/lightline/colorscheme/powerline.vim
136.235  002.825  000.099: sourcing /Users/julieengel/.vim/bundle/lightline.vim/autoload/lightline/colorscheme/default.vim
139.476  004.080: opening buffers
331.383  191.572  191.572: sourcing /Users/julieengel/.vim/bundle/ultisnips/autoload/UltiSnips.vim
334.848  003.800: BufEnter autocommands
334.854  000.006: editing files in windows
354.506  000.669  000.669: sourcing /Users/julieengel/.vim/bundle/nerdtree/syntax/nerdtree.vim
458.561  123.038: VimEnter autocommands
458.565  000.004: before starting main loop
461.225  002.660: first screen update
461.227  000.002: --- VIM STARTED ---

It seems to me that it does get loaded, but somehow it's not getting enabled. Do you know how I could further debug this?

itchyny commented 8 years ago

Do you use the session feature of Vim; :mksession somewhere?

engelju commented 8 years ago

Nope, but I figured it out: I used vim-buftabs and that seemed to mess with Lightline. I also tried vim-bufferline but also to no avail. When they are disabled everything works as expected.

Do you know how I could list the open buffers in lightline, or any plugin that would work? I tried using the functions of bufferline as a component, but couldn't quite get it to work.

As the problem is solved now, I'll close this. Thanks for your fast response though!

itchyny commented 8 years ago

Here is an example to show the bufferline information in the statusline of lightline.


let g:lightline = {
      \ 'active': {
      \   'right': [ [ 'lineinfo' ], [ 'bufferline' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
      \ },
      \ 'component_function': {
      \   'bufferline': 'LightlineBufferLine'
      \ }
      \ }

function! LightlineBufferLine()
  let info = get(g:, 'bufferline_status_info', {})
  if empty(info)
    return ''
  endif
  return info.before . info.current . info.after
endfunction
engelju commented 8 years ago

That works wonderfully, thank you so much!

1ak31sha commented 3 years ago

hey, im having this same issue and i do use the mksession feature

ycd commented 3 years ago

Add this to your vimrc and you will be fine:

set laststatus=2