itchyny / lightline.vim

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

Lightline is not rendering colors and layout as expected #679

Closed adivaste closed 2 months ago

adivaste commented 2 months ago

After going through the documentation and following all the steps, this is how my vim looks:

(as you can see, the layout, colors, and formatting do not match the documentation)

Image 1 Image 2
Image 3 Image 4

Here is my vimrc file:

:set number
:set tabstop=4
:set shiftwidth=4
:set expandtab

" Initialize vim-plug
call plug#begin('~/.vim/plugged')

"Plug 'neowit/vim-force.com'
Plug 'itchyny/lightline.vim'

call plug#end()

" Enable syntax highlighting
syntax on

set laststatus=2

if !has('gui_running')
  set t_Co=256
endif

let g:lightline = {
      \ 'colorscheme': 'powerline',
      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
      \ },
      \ 'component_function': {
      \   'gitbranch': 'FugitiveHead'
      \ },
      \ }

set noshowmode

One unexpected behavior I found while exploring was that whenever I use the command sequence Vex and then q, I get the expected layout and colors like this:

image

However, when I change focus from the terminal tab to another tab, everything reverts to the default.

What could be the issue? Can anyone help?

(I am using Mintty terminal on Windows; you can watch a video of this here)

itchyny commented 2 months ago

Can you paste the output of :scriptnames?

adivaste commented 2 months ago

1: /etc/vimrc 2: /usr/share/vim/vim82/defaults.vim 3: /usr/share/vim/vim82/filetype.vim 4: /usr/share/vim/vim82/ftplugin.vim 5: /usr/share/vim/vim82/indent.vim 6: /usr/share/vim/vim82/syntax/syntax.vim 7: /usr/share/vim/vim82/syntax/synload.vim 8: /usr/share/vim/vim82/syntax/syncolor.vim 9: ~/.vim/vimrc 10: ~/.vim/autoload/plug.vim 11: /usr/share/vim/vim82/ftoff.vim 12: /usr/share/vim/vim82/syntax/nosyntax.vim 13: ~/.vim/plugged/lightline.vim/plugin/lightline.vim 14: /usr/share/vim/vim82/plugin/getscriptPlugin.vim 15: /usr/share/vim/vim82/plugin/gzip.vim 16: /usr/share/vim/vim82/plugin/logiPat.vim 17: /usr/share/vim/vim82/plugin/manpager.vim 18: /usr/share/vim/vim82/plugin/matchparen.vim 19: /usr/share/vim/vim82/plugin/netrwPlugin.vim 20: /usr/share/vim/vim82/plugin/rrhelper.vim 21: /usr/share/vim/vim82/plugin/spellfile.vim 22: /usr/share/vim/vim82/plugin/tarPlugin.vim 23: /usr/share/vim/vim82/plugin/tohtml.vim 24: /usr/share/vim/vim82/plugin/vimballPlugin.vim 25: /usr/share/vim/vim82/plugin/zipPlugin.vim 26: ~/.vim/pack/vendor/start/vim-airline/plugin/airline.vim 27: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/init.vim 28: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/parts.vim 29: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/formatter/short_path.vim 30: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/util.vim 31: /usr/share/vim/vim82/scripts.vim 32: /usr/share/vim/vim82/ftplugin/vim.vim 33: /usr/share/vim/vim82/indent/vim.vim 34: /usr/share/vim/vim82/syntax/vim.vim 35: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions.vim 36: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/quickfix.vim 37: ~/.vim/pack/vendor/start/vim-airline/autoload/airline.vim 38: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/netrw.vim 39: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/term.vim 40: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/section.vim 41: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/highlighter.vim 42: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/whitespace.vim 43: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/po.vim 44: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/wordcount.vim 45: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/keymap.vim 46: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/searchcount.vim 47: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/themes/dark.vim 48: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/themes.vim 49: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/builder.vim 50: ~/.vim/pack/vendor/start/vim-airline/autoload/airline/extensions/default.vim 51: ~/.vim/plugged/lightline.vim/autoload/lightline.vim 52: ~/.vim/plugged/lightline.vim/autoload/lightline/tab.vim 53: ~/.vim/plugged/lightline.vim/autoload/lightline/colorscheme/powerline.vim 54: ~/.vim/plugged/lightline.vim/autoload/lightline/colorscheme.vim

So many out there

itchyny commented 2 months ago

You are using vim-airline plugin, too.

adivaste commented 2 months ago

Right now, I am using lightline only, nothing else. ( Earlier, I was just trying out various plugins, so installed. )

Maybe I should remove other ones ?

itchyny commented 2 months ago

Try rm -rf ~/.vim/pack/vendor/start/vim-airline and then restart Vim.

adivaste commented 2 months ago

Thanks! It's working as expected now.

I removed unused plugins using :PlugClean since I am using vim-plug, and I removed the vim-airline directory itself from ~/.vim/pack/vendor/start/ as I am no longer using it.