发现这小工具真好用. diff 效果惊人.
git 的配置:
$ git config --global diff.tool vimdiff
# 看一下设置是否生效
$ git config --global -l
user.name=***
user.email=***
push.default=simple
http.sslverify=false
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
core.autocrlf=input
credential.helper=cache --timeout=3600
diff.tool=vimdiff # 设置成功
启动 vimdiff:
vimdiff file1.txt file2.txt
vim -d file1.txt file2.txt
cheatsheet:
- zc: close folding (zC to close all)
- za: open folding (zA to open all)
- c-w c-w: jump to another window
- ]c: next difference
- [c: previous difference
- dp: diffput, puts changes under the cursor into the other file making them identical (thus removing the diff); 推过去
- do: diffget, 拉过来;
references: