Questions tagged [vimdiff]

The diff feature of vim lets show differences between two, three or four versions of the same file

Filter by
Sorted by
Tagged with
136
votes
7answers
178k views

How do I use vim as a diff tool?

I use vim as my primary editor. I would also like to use vim to diff files and modify the files while doing the diff to fix easy changes (rather than most diff techniques which are a cycle of diff/...
30
votes
3answers
16k views

How do I customize vimdiff colors?

I am trying to use vimdiff as my git merge tool, but the colors used are making it unbearable (at least on Windows/Mingw): the background color and the foreground color is the same for some of the ...
7
votes
1answer
637 views

How can I suppress the “press enter” prompt when opening files in diff mode?

When using gVim (on Windows; see below) to diff two files which both have very long paths relative to the current working directory, the dreaded "press enter" prompt appears during load, before ...
17
votes
1answer
3k views

More detailed comparison within a line

I use vimdiff to inspect differences between files, and some times it misses out a bit. for example, if I have the following two files: //a.c printf("Hello\n"); and: //b.c int i = printf("hello\n") ...
20
votes
2answers
6k views

Make panes resize when host window is resized

I like to use vimdiff as a git diff/merge tool. The problem is when I resize the host terminal window to a new size: of the two split panes, the leftmost remain of the same width, while the rightmost ...
14
votes
1answer
2k views

vimdiff and merge conflicts

When merging branches under source control there is often the issue of a merge conflict with other developers. I know that we can use vimdiff to diff code changes against source control, but is there ...
6
votes
2answers
2k views

Git mergetool vimdiff command

I'm attempting to get something setup that invokes the vimdiff git merge tool externally, but because of the way the setup works, I need to invoke vimdiff manually (without git mergetool). Does anyone ...
2
votes
1answer
315 views

Stop vim from removing whitespace on save for diff files

I am currently trying to edit a git hunk file (a diff: .git/addp-hunk-edit.diff), and to say to git that a line containing whitespace is unchanged it needs to have (a line with a single space) as its ...
2
votes
2answers
245 views

Diffsplit with output of external command in Vim?

I know I can enter diff mode in vim by calling diffsplit <filename>. I also know I can call an external command and replace the file contents with its output (e.g. in this answer someone uses ...