Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get colors for Inactive buffers and active buffers. #27

Open
ReneFroger opened this issue Dec 26, 2014 · 6 comments
Open

Can't get colors for Inactive buffers and active buffers. #27

ReneFroger opened this issue Dec 26, 2014 · 6 comments

Comments

@ReneFroger
Copy link

Hi Bailey,

Thanks for your awesome work.

I would like to have colors to indicatie if there is a inactive buffer or active buffer. But the option, mentioned in the documentation, didn't worked for me either:

let g:bufferline_active_highlight = 'StatusLine'
let g:bufferline_inactive_highlight = 'StatusLineNC'

I have both set in my Vimrc. And yes, the color properties of the StatusLine and StatusLineNC are setted in the colorscheme file. When I switched to another colorschemes, the different colors in bufferline are not showed either. All colors in bufferline are still using the same color as the rest of my statusline.

Then I tried to unset my Vimrc. Only the options and default colorscheme of GVIM 7.4.415 and latest Bufferline, with windows 7 x64. The empty Vimrc with these settings:

  let g:bufferline_active_buffer_left = ' [ '
  let g:bufferline_active_buffer_right = '] '
  let g:bufferline_show_bufnr = ' 1 '
  let g:bufferline_inactive_highlight = 'StatusLineNC'
  let g:bufferline_active_highlight = 'StatusLine'

But It didn't worked either. I changed the colors in Vim default colorscheme Delek (you can find it too), to differentiate StatusLineNC and StatusLine. But it didn't helped either.

Is something wrong with Bufferline recently, in combination with Windows Gvim?

@aot9
Copy link

aot9 commented Dec 31, 2014

i had same troubles.You should try to add let g:airline#extensions#bufferline#overwrite_variables=0 to your vimrc.
There is some mess with bufferline initialization, because some bufferline options may be overwritten during airline initialization.
Setting ..#overwrite_variables=0 and modifying default bufferline parameters in vim-bufferline/plugin/bufferline.vim worked for me. I still believe there is more graceful way to handle bufferline behaviour, but i have not had enough time to deal with it yet.

@ReneFroger
Copy link
Author

Good to read that I'm not the only one with this weird issue! 😃. But I don't use airline by the way.

I tried it, but it didn't worked. Could you tell me in which ways you modified the bufferline parameters in the bufferline.vim? I tried without any succes.

And by the way, the best wishes for the new year!

@aot9
Copy link

aot9 commented Jan 1, 2015

Hmm, i did not pay much attention to the fact you are using Gvim with Windows. I prefer unix and terminal mode) So i'm not familiar with Windows Gvim, but still pay attention to the way you set colors for highlight groups in vimrc. Colorscheme file is processed after vimrc, so if you have "hi StatusLine guibg=#ff0000" in vimrc and your colorsceme file also has StatusLine color definition, it will be overwritten. Also look inside colorscheme file, it may have complex structure and even if you find the line containing "hi StatusLine ...", it still may not be ever reached. And don't forget that guibg and guifg are for Gvim, ctermbg and ctermfg are for terminal mode vim. Perform simple test: while running Gvim go to vim command line and write "hi StatusLine guibg=#ff0000 guifg=#ff0000", have something just become red? In the end, i want to ask why you want to use Windows Gvim, when threre is Notepad++, Geany and other light and convinient text redactors? Best wishes for you in the new year!

@ReneFroger
Copy link
Author

Thanks for the best wishes!

I tried that before. When I type the StatusLine colors into my Vim command line, the colors of statusline will change to red. But the bufferline in my command line will not change his colors. The colors for active and non-active are still the same...

And I use Windows Gvim, because I like the modal editing, minimailistic layout and the customizability. They're not possible in Notepad++, Geany or not enough as in Vim. :-)

@bling
Copy link
Owner

bling commented Feb 1, 2015

btw, the command bar does not have any colors. are you using the bufferline#get_status_string() helper function?

@jhrmnn
Copy link

jhrmnn commented May 12, 2016

Would it be possible to get colors in the command bar by using terminal escape codes? I tried the following, but that got printed verbatim ("�" is vim's for Esc)

let g:bufferline_active_buffer_left = '�[31;m'
let g:bufferline_active_buffer_right = '�0;m'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants