如何突出显示自上次在 Vim 中保存文件以来更改的行? [英] How to highlight lines changed since the last save of a file in Vim?

查看:22
本文介绍了如何突出显示自上次在 Vim 中保存文件以来更改的行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以让 Vim 突出显示自上次保存以来更改的行?我知道它可以通过版本控制来完成,但是可以没有吗?我不想使用任何版本控制系统,因为我工作的代码没有那个.

Is it possible to have Vim highlight the changed lines since the last save? I know it can be done with version control, but can it be done without? I do not want to use any version control system, because the code I work on does not have that.

我认为,UltraEdit 有类似的东西.

I think, UltraEdit has something like that.

推荐答案

直接来自 Vim 文档(参见:help :DiffOrig):

Straight from Vim documentation (see :help :DiffOrig):

if !exists(":DiffOrig")
    command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
          \ | wincmd p | diffthis
endif

然后只需执行 :DiffOrig 等等

这篇关于如何突出显示自上次在 Vim 中保存文件以来更改的行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆