问题
When I run vimdiff
I get a pretty bad syntax highlighting (unreadable):
Running on MacVim is a little bit better, but still awful.
Is this because of my color scheme (currently using Tomorrow Night)?
If so, is there a way to modify the colours used in vimdiff
outside the theme, or maybe install another ftplugin
that supports this better (not sure about this as set filetype
shows vim
instead of diff
or similar)?
回答1:
Its the color scheme. You would need to modify DiffAdd, DiffChange, DiffDelete, and DiffText. These are the standard highlight groups. The diff syntax file also supports more highlight groups. These groups can be found at the bottom of $VIMRUNTIME/syntax/diff.vim
these default to standard highlight groups. However these colors will only affect the diff filetype.
You can modify the color scheme by using the after directory. Put changes in ~/.vim/after/colorscheme/<colorscheme_name>.vim
these will get sourced after the color scheme is set.
(Personally I haven't found any colors I've liked for vimdiff)
来源:https://stackoverflow.com/questions/24666558/improve-vimdiff-syntax-highlighting