Questions tagged [vimdiff]
The diff feature of vim lets show differences between two, three or four versions of the same file
121
questions
2
votes
0
answers
93
views
Mvimdiff launches with vertical split on far right
I'm trying to integrate mvimdiff into my workflow - but when I launch it via:
git difftool <filename>
I'm getting a wonky layout like this:
_________________________
| | |...
4
votes
1
answer
2k
views
VimDiff incorrectly showing all lines as changed
I am using Vim with fugitive.vim plugin.
Sometimes when diffing files versus their HEAD version from Fugitive's Gstatus window, Vim shows all lines in a file as changed, when in reality only one or ...
5
votes
1
answer
3k
views
Using Vim Diff To Create A Patch File?
I'm currently using vim 7.3 on Windows 7.
The first question I have is it even possible to create the patch file from within vim itself? I understand the basic idea, but anytime I attempt to run
...
1
vote
1
answer
172
views
Vimdiff does not read modeline
I have a modeline in a file
# vim: set filetype=sshconfig :
This sets filetype correctly in vim, but when opening the file in vimdiff, the filetype is set to conf. How can I tell vimdiff to read the ...
14
votes
1
answer
4k
views
Word level diffs in Vim
As far as I understand the default vimdiff is doing only line-wise diffs. However sometimes is useful to do word level diff, especially for text files like Markdown, LaTeX etc. There are some tools ...
2
votes
2
answers
1k
views
Navigate to first diff in diff mode on startup?
Vim diff opens 2 files for diffing, but it doesn't navigate to the first diff section automatically on startup. Can I add something to startup script (like _vimrc) to do this?
1
vote
2
answers
669
views
How to set both files to the encoding in vim diff from command line?
I've opened the files I want to diff using the following command:
C:\temp\robocopyTasks>vim -c "edit ++enc=ucs-2le" -d C:\temp\robocopyTasks\acl\tasks_temp.txt C:\temp\robocopyTasks\acl\tasks_win....
3
votes
1
answer
230
views
Vim Diffing a pair of Unicode little endian without BOM text files in a readable format?
I have a pair of "Unicode little endian without BOM" text files that I would like to diff each other via the command line. Unfortunately when I open them using the command line in vim for Windows ...
2
votes
1
answer
6k
views
How to split window directly from command line? [duplicate]
I'm using Ubuntu system. I have files: A.txt, B.txt, C.txt
I can split window in the following way:
vim A.txt
:vs B.txt // after entering into vim
:vs C.txt
Is there any way to achieve the same ...
5
votes
1
answer
9k
views
Modify vimdiff highlighting
For readability I try to modify my ~/.vimrc to get some proper highlighting. I found here to use e.g. this:
highlight DiffChange cterm=none ctermfg=fg ctermbg=Red gui=none guifg=fg guibg=Red
Like ...
3
votes
2
answers
558
views
Highlight longest common subsequence between two files? line by line
I'm asking about some sort of specialized diff highlighting mode. I need to diff, line by line, files A and B, which look similar to this in vimdiff:
A B
repo/manipulate_1....
11
votes
2
answers
3k
views
Create mappings that only apply to diff mode
In my vimrc I have <C-H>, <C-J>, <C-K> and <C-L> mapped to navigate between split windows in normal mode. When I use diff mode I only ever have windows in vertical splits, so ...
2
votes
2
answers
969
views
c:\Program is not recognized error while running vimdiff
I use windows XP for testing and running some programs. I installed Vim on the machine, but when I run vimdiff on two files, I get the following error:
'""C:\Program' is not recognized as an internal ...
36
votes
3
answers
23k
views
In Vimdiff, how do I switch the left and right panes?
When I do vimdiff file2 file1, file2 naturally goes on the left and file1 on the right.
Sometimes I find that I put them the wrong way round, so I'd like to be able to switch them round without ...
52
votes
5
answers
35k
views
How to diff and merge two directories?
I know that Vim's diff mode (vimdiff) allows us to compare the contents of two (or more) files.
But it is possible to compare content of multiple files across directories in order to merge two ...
8
votes
1
answer
959
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 ...
6
votes
1
answer
1k
views
diffoff on all buffers
Occasionally I have a stray forgotten buffer in which I ran :diffthis. Later when I run :diffthis on some unrelated buffer that second buffer is immediately and unintentionally highlighted with the ...
15
votes
1
answer
3k
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 ...
210
votes
11
answers
283k
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, ...
20
votes
1
answer
4k
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") ...
28
votes
2
answers
8k
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 ...