美文网首页
Vimdiff 笔记

Vimdiff 笔记

作者: district10 | 来源:发表于2017-12-23 23:00 被阅读50次

发现这小工具真好用. 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, 拉过来;
其实呢, c-w c-w 能保持你的 tempo, 敲键的节奏很重要

references:

相关文章

网友评论

      本文标题:Vimdiff 笔记

      本文链接:https://www.haomeiwen.com/subject/lwccgxtx.html