如何仅突出显示 Vim diff 中的实际差异?
How to highlight only the actual differences in Vim diff?
当使用 vimdiff 时,它以 "greedy" 的方式突出显示行的不同部分。即比较两行时:
左边window:这是他家
对window:那个是她家
那么整条线都是粉红色的,但是在左边,is one is his
和右边的at one is her
部分以红色突出显示,作为不匹配:
This one is his home
That one is her home
如何让 vimdiff 只高亮显示实际的差异?
This one is his home
That one is her home
vim 中没有内置任何内容来实现此目的,但您可以使用 diffchar.vim
来实现此目的。
安装插件后,vimdiff
会给你个性差异。
您可以使用 F7 键
在此模式和普通差异模式之间切换
来自插件自述文件:
For example, in diff mode: ([DiffText], )
(file A) The [quick brown fox jumps over the lazy] dog.
(file B) The [lazy fox jumps over the quick brown] dog.
this plugin will exactly highlight the changed and added units:
(file A) The [quick] <brown >fox jumps over the [lazy] dog.
(file B) The [lazy] fox jumps over the [quick] <brown >dog.
请访问https://github.com/rickhowe/diffchar.vim instead of https://github.com/vim-scripts/diffchar.vim。谢谢。
当使用 vimdiff 时,它以 "greedy" 的方式突出显示行的不同部分。即比较两行时:
左边window:这是他家
对window:那个是她家
那么整条线都是粉红色的,但是在左边,is one is his
和右边的at one is her
部分以红色突出显示,作为不匹配:
This one is his home
That one is her home
如何让 vimdiff 只高亮显示实际的差异?
This one is his home
That one is her home
vim 中没有内置任何内容来实现此目的,但您可以使用 diffchar.vim
来实现此目的。
安装插件后,vimdiff
会给你个性差异。
您可以使用 F7 键
来自插件自述文件:
For example, in diff mode: ([DiffText], )
(file A) The [quick brown fox jumps over the lazy] dog. (file B) The [lazy fox jumps over the quick brown] dog.
this plugin will exactly highlight the changed and added units:
(file A) The [quick] <brown >fox jumps over the [lazy] dog. (file B) The [lazy] fox jumps over the [quick] <brown >dog.
请访问https://github.com/rickhowe/diffchar.vim instead of https://github.com/vim-scripts/diffchar.vim。谢谢。