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
1
vote
1answer
18 views

How do I diffput a deleted line?

When viewing a diff of two files in Vim, you can put changes from the source file to the destination file by pressing d then p, or by running :diffput. However, this doesn't work if the change is a ...
1
vote
1answer
45 views

Turn syntax off only for current buffer/window?

Is there a way to turn off syntax for only the current buffer/split windows? like for example, you can set map <buffer> or setlocal. Is there something similar for the syntax option ? I use the :...
1
vote
0answers
42 views

Turn syntax highlighting off in diff mode when started within vim?

I would like syntax to be turned off when I am in diff mode to focus only on the differences. I have the following code in my vimrc which works only when I start vim in diff mode from the command line ...
2
votes
1answer
26 views

Required to write gvimdiff file1 ..\..\..\file2 to diff correctly

I'm trying to diff two files using gvimdiff file1 file2. This works in certain parts of my file system, but if I'm several directories deep, it stops working. Instead, it'll open three files and one ...
1
vote
0answers
41 views

Is it possible to do a reverse vimdiff

There are many answers like this which talk about reversing the search results in one vimbuffer. But I am wondering if there is way to highlight matching lines only in vimdiff. Something like ...
2
votes
0answers
65 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
29 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
19 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 ...
1
vote
1answer
56 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
29 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
190 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
295 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
66 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
43 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
50 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
189 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
134 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
58 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 ...
1
vote
1answer
932 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
228 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
267 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
490 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
108 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
82 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
212 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
65 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
157 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
438 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
374 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
105 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
739 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
488 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 ...
2
votes
1answer
1k 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
403 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
632 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
181 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
253 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
662 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
648 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. ...
4
votes
2answers
948 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
282 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|...
30
votes
3answers
17k 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
213 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
1k 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
163 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
799 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
1k 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?