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
6
votes
5 answers

diffput to multiple buffers?

Sometimes while editing three files using vimdiff I want to copy a hunk from one file to both of the other two. Normally this would be accomplished like so: :diffput 2 :diffput 3 However, :help diffput says this: *:diffpu*…
Cory Klein
  • 51,188
  • 43
  • 183
  • 243
6
votes
1 answer

VIM - Passing colon-commands list via command-line

Good day, I am writing a simple script within my BASHRC file to accommodate something I couldn't quite resolve in a previous question: Side-by-side view in Vim of svn-diff for entire directory I basically generate a list of all files which have a…
Cloud
  • 18,753
  • 15
  • 79
  • 153
5
votes
2 answers

Diff-ing windows in vim

I am working on a script that has become fairly convoluted. I suspect there are several sections that have nearly identical code. Can I (and how can I) open the file in vim, with two (or more) windows on the buffer, and diff the contents of the…
ChrisDR
  • 185
  • 12
5
votes
1 answer

vimdiff E97 in Powershell

I am having trouble getting vimdiff to work on a Windows 10 machine. I am running vim from Powershell. Powershell is also declared in $myvimrc as my shell of choice: set shell=C:\WINDOWS\system32\WindowsPowershell\v1.0\powershell.exe The documents…
root
  • 325
  • 2
  • 11
5
votes
1 answer

Configure vim-diff to show different colors when using it for svn-diff

I have set up 'vimdiff' as my default svn-diff tool by adding below line to ~/.subversion/config diff-cmd = /home/ravikirn/svndiff/diffwrap.sh diffwrap.sh !/bin/sh # Configure your favorite diff program here. DIFF="/usr/local/bin/vimdiff" #…
Ravikiran
  • 1,440
  • 11
  • 15
5
votes
1 answer

Delete the same line in multiple VI windows

I love using vim and vimdiff. I am currently working on comparing two files in vimdiff and I frequently run into the situation that I want to delete the same line in both buffers. In the following example I would like to delete lines 40 and 41. 39…
yulivee
  • 307
  • 2
  • 10
5
votes
1 answer

Can I abort git difftool when multiple files are being compared?

I've made a huge mistake. I've configured git difftool to use vimdiff, and then I've executed a command that compares the entire repository: git difftool tag1 tag2 Now the difftool launches vim in diff mode for each file that has changed. When I…
Alexander Rechsteiner
  • 5,694
  • 5
  • 34
  • 47
5
votes
4 answers

Force git show to show diff using vimdiff

How do I do this? After doing changes via git config I can diff my staged and committed changes with vimdiff but when I do git show I still see the diff in old plain style. How do I make this work for git show as well?
username_4567
  • 4,737
  • 12
  • 56
  • 92
5
votes
1 answer

Open a non-diff window in vimdiff

Sometimes I'm using vimdiff and want to grab code and drop it in a 3rd window/buffer for later reference. When that window is open, though, just about everything is identified as a diff (because it's purposely different than the other two files). …
Benj
  • 1,853
  • 4
  • 18
  • 27
5
votes
2 answers

Merge line by line in vimdiff?

while giving the dp command in vimdiff it replaces the entire block(2 lines) with pink colour on left hand side file to right hand side file. In that block if i want to merge only the second line. First line should not be Merged.
VINOTH ENERGETIC
  • 1,775
  • 4
  • 23
  • 38
5
votes
1 answer

Viewing differences of more than than one pair of files using vimdiff

vimdiff shows differences between two or more of same files. Is it possible to see differences of two pairs of files. For eg, when viewing differenes in .H files and .C file, it will be convenient to go back and forth to see the differences. One way…
balki
  • 26,394
  • 30
  • 105
  • 151
4
votes
2 answers

taking diff between two named files in vim

In my project regression settings, output file have statement like "diff between foo.txt and bar.txt found" Now I need to take vimdiff between foo.txt and bar.txt. Can I do it from output file opened in vim only? currently I need to first…
shampa
  • 1,350
  • 3
  • 13
  • 22
4
votes
2 answers

List pairs of files when using vimdiff as git difftool

I'm using vimdiff as tool when comparing with git difftool. I want to compare 2 commits with git difftool . Today, I have to exit every vimdiff view with :qa to get to the next file pair. Sometimes, the list of file pairs can be…
fbardos
  • 480
  • 1
  • 6
  • 15
4
votes
2 answers

How to merge only remote changes in vimdiff?

After forking a Github repository I performed some changes in it. This was quite some time back, now the upstream branch is well ahead. Thus I wanted to merge those remote changes into my forked repo. I hit upon a merge conflict in one file only. I…
devsaw
  • 1,007
  • 2
  • 14
  • 28
4
votes
1 answer

vimdiff: Different colors for left and right pane

I've started using vimdiff and I'm trying to set up colors for it. The DiffAdd and DiffDelete groups work fine, however I would like DiffChange and DiffText to be different colors for the old and new version of the file respectively. (Specifically,…
Mistodon
  • 627
  • 1
  • 5
  • 12