I was used to doing
git diff | mate
but my new machine does not have mate and I use mvim. So I tried
git diff | mvim
and that did not work. What is the best way to see git diff in mvim editor.
I am using mac and I use mvim.
There is no output to git diff because Git doesn't see any changes inside your repository, only files outside the repository, which it considers 'untracked' and so ignores when generating a diff.
When viewing a combined diff, if the two files you're comparing have a line that's different from what they were merged into, you will see the ++ to represent: one line that was added does not appear in either file1 or file2.
Computing diffsThe diff is dynamically generated from the snapshot data by comparing the root trees of the commit and its parent. Git can compare any two snapshots in time, not just adjacent commits. To compare two commits, start by looking at their root trees, which are almost always different.
I don't know about mvim specifically, but with normal vim you have to give it a filename of - to make it read stdin:
git diff | vim -
Perhaps mvim works the same?
I do believe you might be seeking this... (obviously, with mvimdiff
instead of vimdiff
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With