cormacrelf / vim-colors-github

A Vim colorscheme based on Github's syntax highlighting as of 2018.
375 stars 44 forks source link

Color hard to read when editing git patch #6

Open vincentqb opened 5 years ago

vincentqb commented 5 years ago

In Ubuntu 18.04.02 LTS with gnome terminal:

  1. Edit a file part of a git repository.
  2. git add -p file
  3. select e to edit what is going to be added
  4. if a line starts by "-" to be removed, the text and the background show as red, and thus the text is not visible.
cormacrelf commented 5 years ago

For reference:

diff

I think GitHub has changed its diff colours so there's now black text everywhere. I recall copying the red-on-red/green-on-green pairings from the intra-line diff highlight.

vincentqb commented 5 years ago

What I'm seeing is different: the lines to be removed are solid dark red: gitedit

vincentqb commented 5 years ago

~/.vimrc

call plug#begin('~/.vim/plugged')
        Plug 'cormacrelf/vim-colors-github'
call plug#end()
colorscheme github
cormacrelf commented 5 years ago

This is a bug on the sense that the fallback should be readable. But you should probably find a terminal+environment+configuration that supports termguicolors. The scheme will look way better.

vincentqb commented 5 years ago

Thanks! The following works, though I get a gray background behind the red/green text.

call plug#begin('~/.vim/plugged')
        Plug 'cormacrelf/vim-colors-github'
call plug#end()

" set Vim-specific sequences for RGB colors                                                                                                                                                               
set termguicolors                                                                                                                                                                                         
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"                                                                                                                                                                    
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"                                                                                                                                                                    

colorscheme github  

See also here, and here.

vincentqb commented 5 years ago

Without tmux, I get your image. With tmux, I get a gray background for the modified text as show in image here, but still readable. :)

gitedit_tmux

cormacrelf commented 5 years ago

With tmux, you should be setting TERM and some vim settings differently. I think I check against TERM in vim before flipping switches. Totally possible to have termguicolors within tmux and without , just takes more googling.