vim-colors-github icon indicating copy to clipboard operation
vim-colors-github copied to clipboard

Color hard to read when editing git patch

Open vincentqb opened this issue 6 years ago • 7 comments

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.

vincentqb avatar Aug 05 '19 03:08 vincentqb

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.

cormacrelf avatar Aug 10 '19 16:08 cormacrelf

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

vincentqb avatar Aug 10 '19 23:08 vincentqb

~/.vimrc

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

vincentqb avatar Aug 10 '19 23:08 vincentqb

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.

cormacrelf avatar Aug 11 '19 01:08 cormacrelf

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 avatar Aug 13 '19 18:08 vincentqb

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

vincentqb avatar Aug 14 '19 01:08 vincentqb

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.

cormacrelf avatar Aug 14 '19 05:08 cormacrelf