使用vim有效地管理两个文件之间的差异。
vdiff的Python项目详细描述
在vimdiff中打开两个文件并提供要生成的单笔划键映射 有效地移动两个文件之间的差异。最多可以添加两个文件 同时打开,但通常用作参考。
用法
vdiff[选项]<;文件1>;<;文件2>;[<;文件3>;[<;文件4>;]]
选项
-v, --vim | Use vim (rather than default). |
-g, --gvim | Use gvim (rather than default). |
-f, --force | Edit the files even if they are the same. |
-q, --quiet | Issue only error messages. |
-h, --help | Print this helpful message. |
相关键映射
^{tt2}$ | Move down to next difference |
^{tt3}$ | Move up to previous difference |
^{tt4}$ | Obtain difference |
^{tt5}$ | Push difference |
^{tt6}$ | Update file1 to match file2 |
^{tt7}$ | Update file2 to match file1 |
^{tt8}$ | Save any changes in all files and quit |
^{tt9}$ | Quit without saving any file |
^{tt10}$ | Make all panes the same size and rotate between them |
^{tt11}$ | Update differences |
默认值
默认情况下,如果它存在的话,它将被读取。这是一条Python 用来确定三个变量值的文件:vimdiff, gvimdiff和gui。前两个是用于调用vimdiff和 gVimDiff.公司第三个是一个布尔值,指示哪个应该是默认值。如果 gui为true,默认使用gvimdiff,否则默认使用vimdiff。一个 示例文件可能包含:vimdiff = 'gvimdiff -v' gvimdiff = 'gvimdiff -f' gui = True
这些值也恰好是默认值。
作为一个包
您还可以在自己的python程序中使用vdiff。这样做,你会 大致如下:
from inform import Error from vdiff import Vdiff vdiff = Vdiff(lfile, rfile) try: vdiff.edit() except KeyboardInterrupt: vdiff.cleanup() except Error as err: err.report()
安装
仅在Unix系统上运行。需要Python3.5或更高版本。 通过运行“./install”或“pip3 install vdiff”进行安装。