改进vimdiff语法突出显示 [英] Improve vimdiff syntax highlighting
问题描述
当我运行vimdiff
时,我得到了一个非常糟糕的语法突出显示(不可读):
When I run vimdiff
I get a pretty bad syntax highlighting (unreadable):
在MacVim上运行会更好一些,但仍然很糟糕.
Running on MacVim is a little bit better, but still awful.
这是因为我的配色方案(当前使用的是Tomorrow Night)吗?
Is this because of my color scheme (currently using Tomorrow Night)?
如果是这样,是否可以在主题之外修改vimdiff
中使用的颜色,或者可以安装另一个更好地支持此颜色的ftplugin
(不确定,因为set filetype
显示的是vim
而不是diff
或类似)?
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)?
推荐答案
它是配色方案.您将需要修改DiffAdd,DiffChange,DiffDelete和DiffText.这些是标准的高光组. diff语法文件还支持更多的突出显示组.这些组可以在$VIMRUNTIME/syntax/diff.vim
的底部找到,这些默认为标准突出显示组.但是,这些颜色只会影响diff文件类型.
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.
您可以使用after目录修改配色方案.将更改放入~/.vim/after/colorscheme/<colorscheme_name>.vim
中,这些更改将在设置配色方案后获取.
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.
(我个人没有找到我喜欢的vimdiff颜色)
(Personally I haven't found any colors I've liked for vimdiff)
这篇关于改进vimdiff语法突出显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!