gpt4 book ai didi

svn - 将 vim-diff 配置为在用于 svn-diff 时显示不同的颜色

转载 作者:行者123 更新时间:2023-12-04 09:58:40 25 4
gpt4 key购买 nike

我已将“vimdiff”设置为我的默认 svn-diff 工具,方法是将以下行添加到 ~/.subversion/config

diff-cmd = /home/ravikirn/svndiff/diffwrap.sh

diffwrap.sh


!/bin/sh

# Configure your favorite diff program here.
DIFF="/usr/local/bin/vimdiff"

# Subversion provides the paths we need as the sixth and seventh
# parameters.
LEFT=${6}
RIGHT=${7}

# Call the diff command (change the following line to make sense for
# your merge program).

$DIFF $LEFT $RIGHT

但是,vimdiff 将所有难看的颜色都用于显示差异。我有黑色背景和绿色字体颜色,如何修改 vimdiff 以显示此差异的自定义颜色?我想要一个更愉快的体验。

最佳答案

您可以在您的颜色方案文件中定义颜色。 vimdiff 有几个组亮点:

DiffAdd     diff mode: Added line
DiffChange diff mode: Changed line
DiffDelete diff mode: Deleted line
DiffText diff mode: Changed text within a changed line

在编辑颜色方案文件之前,您可以通过在 vim session 中定义颜色来开始实验,方法如下:
:highlight DiffDelete ctermfg=black ctermbg=yellow 

找到你的颜色后,把它们放在你的配色方案中,然后快乐起来。或者只是将您的高亮声明放在“vimrc”中。取决于你喜欢什么。

顺便说一句,你也可以在做 diff 时切换你的颜色方案。例如,如果您在比较时更喜欢不同的颜色。这是通过以下方式完成的:
if &diff
colorscheme some_other_scheme
endif

祝实验顺利

关于svn - 将 vim-diff 配置为在用于 svn-diff 时显示不同的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4757799/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com