在我的.subversion/config
文件中,我已设置diff-cmd
为调用vimdiff
以查看更改的脚本。
以下是我的问题:我正在查看两个 svn URL 之间的差异,它们修改了 10 个文件。该svn diff url1 url2
命令将打开第一个文件的差异。在 vim 中发出 :qa 将显示第二个文件的差异。现在,有没有办法完全退出 vim,中止进一步查看差异(除了运行 :qa 剩余 8 次)?
更新:以下是我的脚本:
#!/bin/sh
# use vimdiff to view diffs
DIFF="/usr/bin/vimdiff -o"
NUM=$# # number of arguments
LEFT=${6} # old file
RIGHT=${7} # new file
L_TITLE=${3} # actual name and revision of old file
R_TITLE=${5} # actual name and revision of new file
ST="${L_TITLE}"
# get the file name
NAME=`echo $ST | tr -s ' ' '\n' | head -1`
L_BRANCH=`echo $L_TITLE | tr -s ' ' '\n' | head -2 | tail -1`
R_BRANCH=`echo $R_TITLE | tr -s ' ' '\n' | head -2 | tail -1`
# get the old and new revision numbers
L_REV=`echo $L_TITLE | tr -s '(' '\n' | cut -d ')' -f1 | tail -1 | tr -s ' ' '_' `
R_REV=`echo $R_TITLE | tr -s '(' '\n' | cut -d ')' -f1 | tail -1 | tr -s ' ' '_' `
L_REV=`echo "${L_BRANCH}__${L_REV}"`
R_REV=`echo "${R_BRANCH}__${R_REV}"`
# invoke vim
$DIFF $LEFT $RIGHT -c "setl stl=$NAME%20{'$L_REV'} | wincmd W | setl stl=$NAME%20{'$R_REV'}"