joshdick / onedark.vim

A dark Vim/Neovim color scheme inspired by Atom's One Dark syntax theme.
MIT License
3.9k stars 529 forks source link

Missing colors in some languages #7

Closed megamaddu closed 8 years ago

megamaddu commented 8 years ago

I've been using solarized-dark for a while, but I really like the colors in this theme. One problem I have though is that some languages have much less color (especially for symbols) using onedark instead of solarized. I'll just post some screenshots. The two main ones for me are the arrows (->) and symbols (<<<, ., etc) in PureScript and the symbols in JavaScript (const, =, &&, etc).

(FWIW, I find Atom's PureScript highlighting to be a bit odd (good for types, bad for code and imports) and way too colorful for JavaScript)

Solarized, PureScript:

screen shot 2016-01-06 at 11 12 01 am

Onedark, PureScript:

screen shot 2016-01-06 at 11 12 49 am

Solarized, JavaScript:

screen shot 2016-01-06 at 11 14 09 am

Onedark, JavaScript:

screen shot 2016-01-06 at 11 15 00 am

Atom, PureScript:

screen shot 2016-01-06 at 11 17 22 am

Atom, JavaScript:

screen shot 2016-01-06 at 11 18 24 am

And thanks for working on this theme, it's the best I've tried so far!

joshdick commented 8 years ago

I see you're using multiple JavaScript syntax highlighting plugins in your .vimrc, only using one should make JavaScript highlighting look better (I'm currently using othree/yajs.vim).

I don't work with PureScript, but it appears that you're using raichoo/purescript-vim for syntax highlighting. This plugin doesn't appear to add a lot of syntax highlighting groups, at least not with the sample code I tried, so the highlighting provided by that plugin won't be as rich as it appears in Atom. That said, I just pushed b16ba4c99c672aaa64931bc210e0eeb3cf1bb593 which adds a few more previously-empty syntax groups, that may improve things.

megamaddu commented 8 years ago

Awesome, I'll give the update and your JS suggestions a try. Thanks!

joshdick commented 8 years ago

You're welcome!

megamaddu commented 8 years ago

Your update fixed everything : ]

One other note (and maybe this would be better as a separate issue in the airline repo) is the airline background is the same color as the main background, so it's really difficult to see that two files are open here:

screen shot 2016-01-06 at 5 11 09 pm
joshdick commented 8 years ago

Glad to hear it, and thanks for using the theme and for reporting the issue!

It looks like Airline isn't displaying at all for the top split in your screenshot, unless I'm missing something? I see what looks like a normal Vim statusline instead?

megamaddu commented 8 years ago

Right, the status line only shows for the selected pane. Is that normal? If I move to the upper pane it'll show the green "normal" and the file name, which is a little better but still a bit hard to see. Maybe it's just an airline setting. I haven't looked at that in a while.

joshdick commented 8 years ago

Because your screenshot is cut off, I can't tell if you have the right side of Airline disabled or not, but I don't see it on the bottom (and see what looks like the start of "javascript" on the top.) The Airline theme only shows the filename on the left for inactive panes and grays out the colors on the right, so if you have the right side disabled you wouldn't see any of that.

megamaddu commented 8 years ago

Ah, here's another example. It's not a busy file, so it's easier to see there's a divider, but even then it's much harder to tell there's a split when the bottom file is selected.

Top selected:

screen shot 2016-01-07 at 12 10 16 pm

Bottom selected:

screen shot 2016-01-07 at 12 10 29 pm

It's not a big deal though.

joshdick commented 8 years ago

Ah, okay. This is mostly a matter of personal preference. Here's a slightly-edited version of the theme that might be closer to what you're looking for:

" [onedark.vim](https://github.com/joshdick/airline-onedark.vim/)

" This is a [vim-airline](https://github.com/bling/vim-airline) theme for use with
" the [onedark.vim](https://github.com/joshdick/onedark.vim) colorscheme.

" It is based on vim-airline's ["tomorrow" theme](https://github.com/bling/vim-airline/blob/master/autoload/airline/themes/tomorrow.vim).

let g:airline#themes#onedark#palette = {}

function! airline#themes#onedark#refresh()
  let g:airline#themes#onedark#palette.accents = {
        \ 'red': airline#themes#get_highlight('Constant'),
        \ }

  let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['String', 'fg'])
  let s:N2 = airline#themes#get_highlight('CursorLine')
  let s:N3 = s:N2
  let g:airline#themes#onedark#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)

  let group = airline#themes#get_highlight('vimCommand')
  let g:airline#themes#onedark#palette.normal_modified = {
        \ 'airline_c': [ group[0], '', group[2], '', '' ]
        \ }

  let s:I1 = airline#themes#get_highlight('Cursor')
  let s:I2 = s:N2
  let s:I3 = airline#themes#get_highlight2(['Cursor', 'bg'], ['CusrorLine', 'bg'])
  let g:airline#themes#onedark#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
  let g:airline#themes#onedark#palette.insert_modified = g:airline#themes#onedark#palette.normal_modified

  let s:R1 = airline#themes#get_highlight('Error')
  let s:R2 = s:N2
  let s:R3 = airline#themes#get_highlight2(['Error', 'fg'], ['CursorLine', 'bg'])
  let g:airline#themes#onedark#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
  let g:airline#themes#onedark#palette.replace_modified = g:airline#themes#onedark#palette.normal_modified

  let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Statement', 'fg'])
  let s:V2 = s:N2
  let s:V3 = airline#themes#get_highlight2(['Statement', 'fg'], ['CursorLine', 'bg'])
  let g:airline#themes#onedark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
  let g:airline#themes#onedark#palette.visual_modified = g:airline#themes#onedark#palette.normal_modified

  let s:IA1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Normal', 'fg'])
  let s:IA2 = s:N2
  let s:IA3 =  airline#themes#get_highlight2(['Normal', 'fg'], ['CursorLine', 'bg'])
  let g:airline#themes#onedark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
  let g:airline#themes#onedark#palette.inactive_modified = {
        \ 'airline_c': [ group[0], '', group[2], '', '' ]
        \ }
endfunction

call airline#themes#onedark#refresh()
megamaddu commented 8 years ago

Ah yes, thanks!

joshdick commented 8 years ago

You're welcome!