vim 学习日志(13) : vimdiff 配色

字段释义:

  • cterm - sets the style
  • ctermfg - set the text color
  • ctermbg - set the highlighting
  • DiffAdd - line was added
  • DiffDelete - line was removed
  • DiffChange - part of the line was changed (highlights the whole line)
  • DiffText - the exact part of the line that changed

颜色代码:

Below are the cterm-colors, if you want to add your preferred color instead of the ones I used.

       NR-16   NR-8    COLOR NAME
        0       0       Black
        1       4       DarkBlue
        2       2       DarkGreen
        3       6       DarkCyan
        4       1       DarkRed
        5       5       DarkMagenta
        6       3       Brown, DarkYellow
        7       7       LightGray, LightGrey, Gray, Grey
        8       0*      DarkGray, DarkGrey
        9       4*      Blue, LightBlue
        10      2*      Green, LightGreen
        11      6*      Cyan, LightCyan
        12      1*      Red, LightRed
        13      5*      Magenta, LightMagenta
        14      3*      Yellow, LightYellow
        15      7*      White

代码直接加到 用户根目录下,.vimrc 中 就可以了

先上个我的配色:

if &diff
    hi DiffAdd    cterm=bold ctermfg=12  guibg=LightBlue
    hi DiffDelete cterm=bold ctermfg=13 ctermbg=14  gui=bold guifg=blue guibg=LightCyan
    hi DiffChange cterm=bold ctermbg=green ctermfg=15  guibg=Magenta
    hi DiffText   term=reverse cterm=bold ctermfg=9 gui=bold  guibg=Red
endif

 效果:

 

 

不喜欢绿色,可以这样:

if &diff
    hi DiffAdd    cterm=bold ctermfg=12  guibg=LightBlue
    hi DiffDelete cterm=bold ctermfg=13 ctermbg=14  gui=bold guifg=blue guibg=LightCyan
    hi DiffChange cterm=bold ctermbg=Magenta ctermfg=15  guibg=Magenta
    hi DiffText   term=reverse cterm=bold ctermfg=9 gui=bold  guibg=Red
endif

效果:

 

 稍后整理,具体配色是如何调的。。。

posted on 2021-11-09 12:12  细雨微光  阅读(1448)  评论(0)    收藏  举报