将Vimdiff用作Git Difftool时列出文件对
与git difftool
进行比较时,我正在使用vimdiff
作为工具。
我想将2个提交与git difftool< commit1&gt进行比较。 < commit2>
。 今天,我必须使用:QA
退出每个Vimdiff视图,才能到达下一个文件对。 有时,通过这种类型的比较,文件对列表可能很大。然后,我必须键入:QA
数十个次(或:CQ
完成后)。
有没有一种方法可以在QuickFix
,位置列表
或类似的内容中显示所有比较文件对(至少有1个更改)?
,然后,然后获得概述并滚动浏览所有更改并仅显示所选文件的差异将更容易。
我的.gitConfig
的提取:
[diff]
tool = vimdiff
[difftool]
prompt = false
# Be able to abort all diffs with `:cq` or `:cquit`
trustExitCode = true
vimdiff - version
:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 18 2022 19:26:30)
Included patches: 1-3995
git-version
:
git version 2.34.1
I'm using vimdiff
as tool when comparing with git difftool
.
I want to compare 2 commits with git difftool <commit1> <commit2>
.
Today, I have to exit every vimdiff view with :qa
to get to the next file pair.
Sometimes, the list of file pairs can be huge with this type of comparison. Then, I have to type :qa
dozens of times (or :cq
when done).
Is there a way to display all compared file pairs (with at least 1 change) in a QuickFix
, Location List
or something similar?
Then, it would be must easier to get an overview and to scroll through all changes and show only the diff of selected files.
Extract of my .gitconfig
:
[diff]
tool = vimdiff
[difftool]
prompt = false
# Be able to abort all diffs with `:cq` or `:cquit`
trustExitCode = true
vimdiff --version
:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 18 2022 19:26:30)
Included patches: 1-3995
git --version
:
git version 2.34.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
vimdiff
在tool = vimdiff
中实际上不是vimdiff
。它是脚本这真的不允许您想要的东西。可悲的是,
-d
标志,如$ git difftool -d
中的标志无济于事。它打开了两个NetRW窗口,您可以有效地查看哪些文件具有更改,但是整个用户体验比重复:qa&lt; cr&gt;
更笨拙。 :imo,与GUI difftools提供的UX相比,屁股很痛苦:
=“ https://i.sstatic.net/ufq6f.png” alt =“ filemerge”> ,
但是,由于您提到了QuickFix,因此您可能喜欢 git-jump ,可以让您这样做:
这非常适合从一个变化到另一种变化到另一种变化但实际上并不能解决查看实际差异的问题。
也许是第三方插件,例如这个可以有所帮助,但您必须提出一个适当的GIT整合。
这听起来像是一个很酷的周末项目。
The
vimdiff
intool = vimdiff
is not actuallyvimdiff
. It's a script that doesn't really allow for what you want.Sadly, the
-d
flag, as in$ git difftool -d
, is not helpful as is. It opens two Netrw windows where you can effectively see which files have changes but the whole user experience is a lot more clunky than repeating:qa<CR>
, even a hundred times:IMO, it's a pain in the ass compared to the UX provided in GUI difftools:
But, since you mentioned the quickfix, you might like git-jump, which lets you do:
Which is pretty good for navigating from one change to another but doesn't really help solving the problem of seeing the actual diff.
Maybe a third-party plugin like this one could help but you would have to come up with a proper Git integration.
That sounds like a cool week-end project.
您可以
i code一个vim脚本以扩展netrw树,所以我可以搜索它,
也可以轻松打开DIFF ...
you can
i code a vim scrip to expand netrw tree at all ,so i can search it ,
also can open diff easy...