Using vimdiff to view single diffs

    hg cat <filename> | vim - -c  ":vert diffsplit <filename>" -c "map q :qa!<CR>";

Using bash to save as a command:

hgdiff() {
    hg cat $1 | vim - -c  ":vert diffsplit $1" -c "map q :qa!<CR>";
}

Then just use hgdiff <filename> to invoke, and q from within vim to quit.

ErikTerpstra added:

If you want the new version on the right side, try this instead:

hgdiff() {
    vimdiff -c 'map q :qa!<CR>' <(hg cat "$1") "$1";
}


CategoryTipsAndTricks