Is there any good macvim git diff?

I have been using textmate for many years, and I just switched to macvim, and one thing I used all the time with textmate was the command git df, which in my .gitconfig was just an alias for

[alias]
    df = !git diff | mate 

and that it gave me a screen like this

enter image description here

Is there a replacement in mvim that I can add somewhere for me to get similar behavior

+3
source share
2 answers

I describe what I use here .

Basically, add the following lines to your "~ / .gitconfig":

[diff]
    tool = default-difftool

[difftool "default-difftool"]
    cmd = default-difftool.sh $LOCAL $REMOTE

With the following shell script:

#! /bin/bash

if [[ -f /Applications/MacVim.app/Contents/MacOS/Vim ]]
then
    # bypass mvim for speed
    VIMPATH='/Applications/MacVim.app/Contents/MacOS/Vim -g -dO -f'
elif [[ -f /usr/local/bin/mvim ]]
then
    # fall back to mvim
    VIMPATH='mvim -d -f'
else
    # fall back to original vim
    VIMPATH='vimdiff'
fi

$VIMPATH $@
+1
source

You can get diff one file at a time:

git difftool -t vimdiff

vimdiff gvimdiff gvim, , mvimdiff macvim.

, git diff vim.

0

All Articles