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

Color hard to read when editing git patch #6

Open
vincentqb opened this issue Aug 5, 2019 · 7 comments
Open

Color hard to read when editing git patch #6

vincentqb opened this issue Aug 5, 2019 · 7 comments

Comments

@vincentqb
Copy link

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
Copy link
Owner

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
Copy link
Author

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

@vincentqb
Copy link
Author

~/.vimrc

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

@cormacrelf
Copy link
Owner

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
Copy link
Author

vincentqb commented Aug 13, 2019

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
Copy link
Author

vincentqb commented Aug 14, 2019

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
Copy link
Owner

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.

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

2 participants