Questions tagged [vimdiff]

vimdiff is a vim mode that can show differences between two, three or four files.

vimdiff is the same as vim -d or using :diffthis on several windows in the same vim tab.

Use dp to propagate a difference and do to get it, ]c and [c to navigate between differences.

202 questions
10
votes
1 answer

Vimdiff: How to put all changes inside a particular function from one file to another?

In Vimdiff, I know I can use "do" or "dp" to move changes from one file to the other...but these are for individual changes. If I have to undo all changes inside a specific scope/selection (say undo all changes to a particular function, but leave…
TCSGrad
  • 11,898
  • 14
  • 49
  • 70
9
votes
3 answers

Using diffget in vimdiff

I'm trying to learn to use vimdiff well. Currently I figured out how to get a block of diff from a buffer to another (using do) but what I'm willing to do now is to simply get one (or some) line of a block in the other buffer. The vimdiff…
claf
  • 9,043
  • 17
  • 62
  • 79
9
votes
3 answers

How Do You Get the bufspec While Using Vimdiff Through Git

I've read Vimdiff and Viewing differences with Vimdiff plus doing various google searches using things like "vimdiff multiple", "vimdiff git", "vimdiff commands" etc. When using do or diffg I get the error "More than two buffers in diff mode,…
8
votes
2 answers

How to successfully exit "vimdiff" (which is used as a merge tool for "git") without saving?

I am new to this, so apologies about the basic question. I am using an Ubuntu environment. I have git installed. I setup vimdiff as the merge tool. I am testing the environment, but I am having a problem. I created a conflict in a readme.txt file.…
Greeso
  • 7,544
  • 9
  • 51
  • 77
8
votes
2 answers

How to highlight only the actual differences in Vim diff?

When using vimdiff, it highlights the differing portion of the lines in a "greedy" fashion. That is, when comparing two lines: Left window: This one is his home Right window: That one is her home then the whole line is colored pink, but on the left,…
ysap
  • 7,723
  • 7
  • 59
  • 122
7
votes
4 answers

Redirect command to input of another in Python

I would like to replicate this in python: gvimdiff <(hg cat file.txt) file.txt (hg cat file.txt outputs the most recently committed version of file.txt) I know how to pipe the file to gvimdiff, but it won't accept another file: $ hg cat file.txt |…
alif
  • 619
  • 1
  • 6
  • 10
7
votes
0 answers

Git difftool submodules

I'm thinking about using submodules in a way that they aren't really meant for but my goal is to streamline some things for the devs. I've got a project that is basically made up of only submodules - 4 of them. It is important that they are…
BLowe
  • 306
  • 1
  • 11
7
votes
2 answers

How can I make git difftool to use gvim (gvimdiff)?

There seems to have been a change in git which makes it no longer work correctly with gvim as the diff tool. Specifically, I always used to use the gvim -geometry flag to maximize the window. Now, I end up with one of the windows blank (empty/zero…
Alan Thompson
  • 29,276
  • 6
  • 41
  • 48
7
votes
1 answer

Improve vimdiff syntax highlighting

When I run vimdiff I get a pretty bad syntax highlighting (unreadable): Running on MacVim is a little bit better, but still awful. Is this because of my color scheme (currently using Tomorrow Night)? If so, is there a way to modify the colours…
jviotti
  • 17,881
  • 26
  • 89
  • 148
7
votes
1 answer

diff - find specific change between two values in hex dump

I am analyzing hex data from binary data dumps from a basic command-line program of mine. I'm basically dumping the exact contents of a struct (a large array of structs, actually) to a text file. I then create a second binary dump, and compare the…
Cloud
  • 18,753
  • 15
  • 79
  • 153
7
votes
2 answers

Using vim as git difftool

I've configured Vim as git difftool in .gitconfig [diff] tool = vimdiff If there are changes in N files, i have to close vim (:qa) to see the next diff. How do i navigate to the next/previous diff without quitting vim?
Sathish
  • 20,660
  • 24
  • 63
  • 71
6
votes
2 answers

open repo file instead of a tmp file to modify in git difftool

git difftool --tool=vimdiff --no-prompt HEAD~1 HEAD git will open vim with two temporary files on the left and right side. Is there a way to force open the repo file on the right so that I can modify it directly?
Justin Lin
  • 673
  • 1
  • 6
  • 15
6
votes
2 answers

Why git difftool does not open vimdiff in case of conflicts?

After reading this, I configured git to use vimdiff as diff/merge tool by adding following lines to my ~/.gitconfig: [diff] tool = vimdiff [merge] tool = vimdiff [difftool] prompt = false [alias] d = difftool But…
Vram Vardanian
  • 539
  • 1
  • 5
  • 15
6
votes
3 answers

Using gvim to print diffs?

Is there a way to print out the diffs like they show when you open them with "gvim -d", with all the common code folded away and only the diffs showing in context? I tried the print menu option, but it printed the entire file that I was currently…
Paul Tomblin
  • 179,021
  • 58
  • 319
  • 408
6
votes
4 answers

vimdiff and CVS integration

I've always wanted to be able to get a reasonably elegant way of getting vimdiff to work with a CVS controlled file. I've found numerous (somewhat hacky) scripts around the internet (best example here) that basically check out the file you are…
sanmiguel
  • 4,580
  • 1
  • 30
  • 27