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
2
votes
0answers
31 views

Vimdiff : highlight line numbers differently

I use relative line numbers thanx to the following settings in my vimrc: set number set relativenumber Since I don't want to wrap lines in diff mode, it's sometimes hard to tell which line include a ...
0
votes
0answers
19 views

How do I disable conceal mode when doing diffsplit in Vim?

I would like the conceallevel be set to 0 whenever I do diffsplit, and set it to 2 when I get out of diff mode.
1
vote
0answers
18 views

Is it possible to use Vim's power (Vim buffers…) while doing 3 way merge in Meld?

Is it possible to use Vim's power (Vim buffers...) while doing 3 way merge in Meld ? I can see in Meld you can change the default editor: edit -> Preferences -> Editor -> default editor I ...
0
votes
1answer
40 views

Any difference between vimdiff and vim -d?

Are there any differences between using vimdiff x.py y.py and vim -d x.py y.py?
2
votes
0answers
25 views

Lock the first line when doing diff between two files in vimdiff

I am trying to do a diff between a couple of csv files. I have performed column -t -s"," on both the files to be able to compare better. The first row contains the column names and I want to lock it ...
3
votes
1answer
115 views

How do I enter into vimdiff mode given two splits are already open?

I know you would normally enter into vimdiff mode from the terminal with vimdiff file1 file2. However, I frequently find myself already in vim with multiple different splits, and I'd like to run ...
5
votes
1answer
239 views

IDE-like inline diff highlighting in Vim

I enjoy using Vim and like it better than IDEs on most points. One common IDE feature that I miss, though, is inline diff highlighting: In this example changed lines are highlighted in blue and ...
4
votes
0answers
56 views

VIMDIFF missing small differences

I have two nearly identical very large files (890,000+ rows of exactly 899 characters each fixed length file). On rows 289141-289148 one file has a pipe character in column 38, and the other file has ...
1
vote
1answer
33 views

How vimdiff links to vim

When i do a ls -l /usr/bin/vimdifff it shows following /usr/bin/vimdiff -> vim Does this mean vimdiff and vim are the same? I know that we can use vim for diff by giving -d. But how does linking ...
0
votes
1answer
38 views

vimdiff: disable option iwhiteeol in diffopt

I want to see trailing white space differences using internal diff. By default vim uses iwhilteeol. Is there a way to turn this option off?
3
votes
1answer
162 views

If one can diff from Vim without the need to boot `vimdiff` then why is it a binary program?

Before you start reading. Before having answers, I thought vimdiff was a binary program because I'm used to Debian's file, which seems not to honor POSIX (but I didn't knew); but then I used macOS 10....
1
vote
2answers
111 views

How to run Vim Diff without enter in interctive mode?

I really like the vimdiff / vim -d , it's awesome. But I need to see the vimdiff result without enter in the interactive mode. Show the result colored , scrolling all differences and exit. Behave ...
2
votes
0answers
57 views

Is there a better way to diff from a patch?

Background: I'm working on a large project that has some disparate coding styles. I'm working on unifying that but only the parts that I've most recently touched. The tool that I'm using produces a ...
0
votes
1answer
592 views

`vimdiff` nor `nvim -d` are working as an external diff tool for git

First line says output is not a terminal. The rest of the output looks like term codes aren't being processed. I use st, with $TERM = st-256color. I just tried it on termite ($TERM = xterm-termite) ...
0
votes
2answers
185 views

Vimdiff: Is there a way of knowing if there are differences in the diff files or not?

I am trying to find (in Vim script) if the 2 files open using vimdiff are same or different? Is there a way to do that? (a variable like &diff perhaps?)
0
votes
3answers
195 views

Find duplicate entries in two different lists

I have two different lists of words and I want to make sure that they have no mutual duplicates. In other words, none of the words in list A can be in list B and vice versa. They must be mutually ...
1
vote
2answers
373 views

Show changes since buffer was opened

Is it possible to show all changes made to a buffer since the buffer was opened? This question https://stackoverflow.com/questions/749297/can-i-see-changes-before-i-save-my-file-in-vim is related, ...
0
votes
0answers
90 views

make vim produce patch files without editing originals

I want to edit text files with vim, I would love vim file.txt To work like normal, and open file.txt in vim, like normal, and allow me to edit it seemingly like normal. The only difference is, all ...
1
vote
0answers
79 views

How to diff/edit two versions of the same file with vim? [duplicate]

I need to repeat the following workflow multiple times: I have a repository with two branches I need to work simultaneously with two revisions of the same file, each revision belonging to one of the ...
3
votes
1answer
166 views

How to jump to the line of a diff?

If I have a diff file open in vim (not vimdiff), is there a way to jump to the line under the cursor? Something like this: Detect the hunk of text under the cursor. Open a buffer for the file ...
2
votes
0answers
61 views

“diff”-ing current with “earlier” time

I have a file opened and I know I can do :diffsplit to open the file in a diff view. I also know that I can do something like :earlier 30m to see how the file was 30 minutes ago. My question is: how ...
0
votes
1answer
146 views

How to compare two different Vim installs?

Basically, I want to compare which features were enabled when each installation of Vim was compiled. If there's also other significant differences between the two installations, besides their feature-...
1
vote
1answer
390 views

diffpatch using the output of git diff directly

I guess many of you are like me, and even if they have been using ViM for years, still learn new features regularly. The last that I learned was :diffp[atch] patch/name Now, I want to combine it ...
0
votes
1answer
338 views

How can I see which buffers are in diff mode?

:ls shows my buffers and lists flags for each buffer, but doesn't list whether &diff is set. Plugins like unite's buffer source just rely on :ls output. Is there an easy way to list and manage ...
1
vote
1answer
1k views

Visualize git commit diff similarly to mergetool

I've been thinking of ways to visualize git commits with vim. I would like to be able to: run a command from the terminal such as: vimdiff -c <commit id>. vim opens with two windows on a ...
1
vote
1answer
94 views

How can I determine if *any* window in the current tabpage is in diff-mode?

So, I found this useful answer about iterating buffers; but due to the tabpage-specific duality of windows in Vim, I failed at adapting it to my needs. Thus: how can I construct a boolean expression, ...
1
vote
1answer
702 views

How to use pure Vim as git mergetool?

Whenever there are some git merge conflicts we would type git mergetool and git would automatically launch a merge tool for us to merge the conflicts. I have been using vimdiff for a long time as my ...
1
vote
1answer
445 views

How to apply patch to a buffer in place?

I want to use yapf to reformat parts of python buffers. Yapf can take input from stdin yapf -l 30-40. This would produce output that is the whole buffer but with lines 30-40 reformatted. I can then ...
1
vote
1answer
912 views

Using Vimdiff to diff two things that are not local documents

Every now and then I want to diff two random things (like a source-code vs some code I find online). I could obviously create two files locally and diff them, - but I was wondering if there was a ...
10
votes
2answers
1k views

How do I differentiate between vim and vimdiff from within vimrc?

I have a function in vim which will open all buffers as tabs. However after I add this function, vimdiff too opens the files to be compared as different tabs and hence doesn't show the differences. Is ...
1
vote
1answer
329 views

How to customize the color of an HTML output file generated from Git Bash?

I have used the following command in Git Bash to perform a 'vimdiff' for 2 XML files. vimdiff xml1.xml xml2.xml -c TOhtml -c 'w! result.html' -c 'qa!' The HTML file which is getting generated is ...
1
vote
1answer
542 views

How to make gvimdiff works under MobaXterm or cygwin?

I am using Mobaxterm which has cygwin tools. vim/gvim are working fine. I am using same vimrc file for both (with -u option). Note that I have same issue without any vimrc file. To make vimdiff ...
3
votes
1answer
157 views

Multi-command with normal mode and execute mode

Using vimdiff, I can compare two files and generate it's corresponding HTML via the following command: : TOhtml | wq | q | q (the wq will save the Diff.html file, and the two qs will quit out of the ...
2
votes
2answers
239 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 ...
2
votes
1answer
572 views

How to set colorscheme of vimdiff using .vimrc

I want to set colorscheme during vimdiff at startup. Note this colorscheme would be different than Vim's colorscheme.
2
votes
1answer
574 views

Automatically disable cursorline when in diff mode?

I typically use set cursorline by default and it works reasonably well with my preferred color schemes (molokai, vividchalk, moonfly). In normal mode. In diff mode, it almost always screws things up. ...
3
votes
2answers
837 views

How to start Vimdiff without equal sections folded?

I'd like vimdiff to start with all the folded sections opened. So far I have tried the following: vimdiff -c "set nofoldenable" -R <(tree -d directory1) <(tree -d directory2) with the -c "set ...
2
votes
0answers
275 views

How to execute a function when a diff closes

I have a setting (namely highlight the 81st character on the line) that I would like to turn off when there is a diff. This is easy enough as a search through the autocmds results in: |FilterWritePre|...
29
votes
3answers
14k 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 ...
13
votes
3answers
4k views

Is there a way to “take both” when using Vim as merge tool?

I'm using Vim as a 3-way merge too with Git and sometimes need to take changes from both local and remote branches. kdiff3 can do this with a couple of key presses, is there a way to do this in Vim?
3
votes
2answers
206 views

Two seperate diff sessions on one screen

I would like to compare File1-v1.txt with File1-v2.txt and File2-v1.txt with File2-v2.txt at the same time. I tried to create the following layout: +------------------+------------------+ | ...
4
votes
1answer
936 views

vimdiff two files, one ro the other rw

I am scripting a diff program between two longs paths and want one file to be read-only and the other to be read-write. e.g. I want to run something like srcdiff test.c and my script will expand that ...
1
vote
0answers
160 views

diff or vim -d colorscheme [duplicate]

I need a readable colorscheme for vim -d (or vimdiff). My problem is that some lines aren't readable (see picture), white text on yellow background: I tried also the following in ~/.vimrc: if &...
2
votes
1answer
734 views

Diff more than 4 buffers at the same time

I often want to diff more than 4 files, but I run into E96: Can not diff more than 4 buffers. This limit seems to be compiled into vim, and it also seems rather arbitrary. Is there anything I can do ...
3
votes
1answer
904 views

Get a vimdiff view of changes made by a patch / diff file

How do I get a vimdiff view of the effects of patching a file?
2
votes
1answer
305 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
1answer
833 views

vim diff isn't working while my shell is powershell

My settings for shell are: set shell=powershell\ -ExecutionPolicy\ Unrestricted\ -NoProfile\ -NoLogo\ -NonInteractive set shellcmdflag=-Command And when i'm using that, I'm getting following error ...
4
votes
1answer
4k views

Using vim diff to compare the working directory to the HEAD in git?

Is it possible to use vim diff to open and compare all the differences between HEAD and the files in the working directory?
3
votes
2answers
548 views

Make vim switch to other window after opening a diff

99% of the time when I am opening a diff (using the :diffsplit command), it's because I want to reference some code, but still edit the file I started in. However, whenever you open a diff with ...
8
votes
1answer
582 views

Move to next unmatched line with vimdiff

Is there a way to move to the next unmatched line with in vimdiff? Not "move to the next changed line", but move to the next unmatched line for the current file. In my case I'm trying to compare two ...