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

Powerline colors #12

Closed
blueyed opened this issue Dec 4, 2013 · 6 comments
Closed

Powerline colors #12

blueyed opened this issue Dec 4, 2013 · 6 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Dec 4, 2013

I wanted to report, that Powerline colors are a bit off, especially with bg=dark, where the window status bar is hardly visisble for inactive windows.

Then I have seen it on the todo list already.

Have you looked into this already?

For reference, the colors and transitions ("nc" => "not current") are in ./powerline/config_files/colorschemes/vim/default.json.

Thanks!

@morhetz
Copy link
Owner

morhetz commented Dec 4, 2013

@blueyed
Well, while it's still in my todo-list iI quit using Powerline in favor of Airline accompanied with built-in "tomorrow-theme". So powerline-theme has the least priority for me now. However, if you'd like to get this thing done gruvbox is opened for pull request. Sad but true.

@blueyed
Copy link
Contributor Author

blueyed commented Dec 4, 2013

@morhetz
No problem! I have just looked at airline also.
Do you recommend the tomorrow theme as default for gruvbox users? Then I could submit a pull request to add it to the airline_theme_map map.

@morhetz
Copy link
Owner

morhetz commented Dec 4, 2013

@blueyed
I couldn't say it's definitely right theme for gruvbox, but it's the only one using default theme colors, without declaring specific colors itself. This way it should fit any theme you use. Since I'm got used to it pretty quickly, yes, probably, that's the only airline theme I could recommend for other gruvbox users.

Speaking of g:airline_map_theme, that's a good point as I've never thought of such kind mapping. But as I've looked at airline's sources and docs there is no easy and generic way to do so. I don't like pushing anything to airline's code since it's kind'o hardcode. Redefining this var at gruvbox theme with something like this would help:

let g:airline_theme_map = {
     \ 'Tomorrow.*': 'tomorrow',
     \ 'mo[l|n]okai': 'molokai',
     \ 'wombat.*': 'wombat',
     \ '.*solarized.*': 'solarized',
     \ 'gruvbox.*': 'tomorrow',
     \ }

However I'll stuck keeping this lines up-to-date with any airline's changes. So the best way would be having some generic solution, which other vim-colorschemes could use also. Something like that at colorscheme:

if !exists('g:airline_theme_map')
   let g:airline_theme_map = {
      \ 'gruvbox.*': 'tomorrow',
      \ }
else
   let g:airline_theme_map['gruvbox.*'] = 'tomorrow'
endif

And ask Bailey Ling to modify s:check_defined function for g:airline_map_theme same way:

function! s:check_dictionary(variable, default)
  if exists(a:variable)
    call extend(a:default, {a:variable})
  endif

  let {a:variable} = a:default
endfunction

----

call s:check_dictionary('g:airline_theme_map', {
      \ 'Tomorrow.*': 'tomorrow',
      \ 'mo[l|n]okai': 'molokai',
      \ 'wombat.*': 'wombat',
      \ '.*solarized.*': 'solarized',
      \ })

Or even more generic:

function! s:check_defined(variable, default)
  if !exists(a:variable)
    let {a:variable} = a:default
    return
  endif  

  if (type({a:variable}) == type({})) || (type({a:variable}) == type([]))
    call extend(a:default, {a:variable})
    let {a:variable} = a:default
  endif
endfunction

@bling
Copy link

bling commented Dec 4, 2013

airline already supports this. just put in the code snippet you had earlier into your vimrc:

if !exists('g:airline_theme_map')
   let g:airline_theme_map = {
      \ 'gruvbox.*': 'tomorrow',
      \ }
else
   let g:airline_theme_map['gruvbox.*'] = 'tomorrow'
endif

and it'll work!

@morhetz
Copy link
Owner

morhetz commented Dec 4, 2013

@bling
Crap, I've been using outdated airline version that haven't used extend for dictionaries. Thank you!

morhetz added a commit that referenced this issue Dec 8, 2013
@morhetz
Copy link
Owner

morhetz commented Dec 8, 2013

Commited airline theme mapping. Closing this, as Powerline support is not planned anymore.

@morhetz morhetz closed this as completed Dec 8, 2013
Splinter1984 pushed a commit to Splinter1984/gruvbox that referenced this issue Nov 2, 2023
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

3 participants