整个目录中svn-diff的Vim并排视图 [英] Side-by-side view in Vim of svn-diff for entire directory
问题描述
我在OSX机器上安装了MacVim,因此默认的Vim
应用程序(即/usr/bin/vim)实际上是与MacVim附带的Vim命令行版本的符号链接(即: /Applications/MacVim.app/MacOS/vim),因为与OSX10.6附带的Vim股票相比,它提供了一些关键优势.
I have a MacVim setup on my OSX machine so that the default Vim
application (ie: /usr/bin/vim) is actually a symbolic link to the command-line version of Vim that ships with MacVim (ie: /Applications/MacVim.app/MacOS/vim), as it provides some key benefits over the stock Vim that ships with OSX10.6.
我定期需要准备一组文件之间的差异,并将其导出到彩色的并排查看HTML文件中.通常可以通过以下方式实现:
I periodically need to prepare a diff between a set of files, and export it into a colorful side-by-side-view HTML file. This is commonly achieved via:
vim -d file1 file2
(Within Vim): toHTML
此问题是我必须手动检出HEAD版本和两组文件的特定版本,并对每对文件执行此操作.这非常耗时.
The problem with this is that I have to manually check out the HEAD revision and a specific revision of the two sets of files, and do this operation for each pair of files. This is very time consuming.
是否有可能将svn diff
命令的结果传递到Vim中,所以我可以为整个目录(即PWD)提供一个彩色的并排查看差异,而不是统一的差异查看?
Is it possible to have the results of svn diff
command piped into Vim so I can have a colorful side-by-side-view diff for an entire directory (ie: the PWD), as opposed to just the unified diff view?
我发现了几种试图实现此目的的Vim脚本和bash脚本,但是存在两个关键问题:
I have found several Vim scripts and bash scripts that attempt to achieve this, but there are two key problems:
-
我希望显式调用
vim -d
作为diff工具,而不是vimdiff
,因为MacVim应用程序似乎未随vimdiff
一起提供,因此当使用以下版本的Vim时,我会使用错误的版本启动应用程序
I wish to explicitly call
vim -d
as the diff tool, and notvimdiff
, as the MacVim application does not appear to ship withvimdiff
, so I would be using the wrong version of Vim when launching the application
我希望递归地针对整个目录生成多文件差异,而不是一次只生成一个或两个文件.
I wish to have multi-file diffs generated against an entire directory recursively, as opposed to just one or two files at a time.
如果这不可行,我可能会创建一个或多或少可以实现此目的的bash脚本,但是如果有更有效的方法,我希望避免将被黑/不可靠的脚本放在一起.
If this is not feasible, I could likely create a bash script that more-or-less achieves this, but I'd like to avoid putting together a hacked/unreliable script if there is a more effective means of doing this.
谢谢.
推荐答案
此后,我在另一本我的较新帖子中已完全解决了此问题.向其发布回溯URL,以供将来的读者使用:
I have since resolved this fully in another, more recent post of mine. Posting a backtrack URL to it for future readers:
这篇关于整个目录中svn-diff的Vim并排视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!