0

在git diff时使用vimdiff

Posted by 晴云孤魂 on 2014 年 03 月 03 日 in web development |

git 配置

在shell中输入以下命令修改git配置,启用vimdiff。

git config --global diff.tool vimdiff  
git config --global difftool.prompt No

之后使用下面命令就可以通过vimdiff来查看diff,跟以前略有不同。

git difftool

vimdiff配色方案

如果vimdiff中默认配色看不清楚差异,推荐使用peaksea配色方案,下载后放到~/.vim/colors/目录下。修改~/.vimrc选择配色方案。

if ! has("gui_running")  
    set t_Co=256  
endif  
if &diff  
    colors peaksea  
endif

vimdiff操作

一篇简单的教程《Quick and Dirty: Vimdiff Tutorial》
一次退出所有窗口的命令是:qa
最后效果如图
vimdiff.png

Copyright © 2011-2024 晴云孤魂's Blog All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.

普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress