Skip to main content

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
3 answers
125 views

I am but a simple man… I work on a black-background, light-gray foreground terminal, and I am a long-time, but in no way an expert, user of Vim. Disliking the default color scheme, many years ago I ...
einpoklum's user avatar
  • 121
1 vote
3 answers
124 views

I often use diffthis to compare timestamped logs e.g. from dmesg. I would like to skip those timestamps when computing the diff so the two lines below are considered the same: [ 0.003621] Early ...
Dominik Kaszewski's user avatar
1 vote
1 answer
185 views

:help jumpto-diffs gives commands to jump between changes in a vimdiff: Two commands can be used to jump to diffs: *[c* [c Jump backwards to the previous start ...
idbrii's user avatar
  • 832
0 votes
1 answer
627 views

In plain old (n)vimdiff, one can jump to the next/previous difference using [c or ]c respectively. (says :help diff documentation, at least) Not so much in my AstroNvim; running nvim -d -R old.txt new....
Marcus Müller's user avatar
1 vote
1 answer
183 views

My python code opens a subprocess which in turn calls vimdiff and :toHTML. Snippet added below: subprocess.check_call( [ "vimdiff", ...
Gunjan Kokiloo's user avatar
1 vote
1 answer
117 views

Vim help suggests a nice command to show a side-by-side diff of the current buffer since the last save: command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ \ | diffthis | wincmd p | ...
Canis Lupus's user avatar
1 vote
2 answers
219 views

If I have a block of contiguous flagged lines in vimdiff, then it treats them as if they were a single diff, and pressing 'dp' sets the other buffer the same for the entire block. Is it possible to ...
workisa4letterword's user avatar
1 vote
0 answers
101 views

I want line numbers to be highlighted for diff files depending on added lines and removed lines. For added lines, the line number should be green. For removed lines, the line number should be red. I ...
Amarakon's user avatar
  • 281
0 votes
1 answer
115 views

Since the keys o and p are close and sometimes I mistype them. I would like to remap diffget and disable do.
Arch Stanton's user avatar
0 votes
1 answer
353 views

I have a few options I like to apply both when Vim is opened in diff mode and when it is switched to diff mode, e.g., when calling diffsplit. I have the following lines in my ~/.vimrc: command! -nargs=...
Matt's user avatar
  • 207
4 votes
1 answer
573 views

I'm trying to configure vimdiff as a git merge tool, so my global git config contains the following lines: [merge] tool = vimdiff conflictstyle = diff3 prompt = true [mergetool "...
gigoQ's user avatar
  • 43
3 votes
1 answer
390 views

I read "the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names" from here. Exactly what are those identifiers, and does :diffget //2 work for ...
G. Bai's user avatar
  • 355
0 votes
0 answers
48 views

I need to open 4 different files on my screen to consolidate data on diff file . I kept forgetting which tile is which file.. All my files has file name on line 1.. Is there way to keep the line 1 ...
purityKEF's user avatar
4 votes
1 answer
976 views

Given a patch (without having both files, e.g.) git show -c > some_patch.c, is it possible to view this patch in vimdiff with a side-by-side view? Or does this require having both source and ...
ideasman42's user avatar
  • 3,833
1 vote
1 answer
323 views

I use the solution provided here, reproduced below: function! s:DiffWithSaved() let filetype=&ft diffthis vnew | r # | normal! 1Gdd diffthis exe "setlocal bt=nofile bh=wipe nobl ...
Tryer's user avatar
  • 247
0 votes
0 answers
73 views

I know that when doing a diff, and issuing TOhtml, it will export the entire tab into HTML. How can one do the same without those windows in the tab not being diffed? :help TOhtml shows all the ...
toraritte's user avatar
  • 412
0 votes
0 answers
27 views

I have a program file prog.pl and a backup prog.pl-20210615. At first they are identically. But then I want edit prog.pl and see the differences to the backupfile prog.pl prog.pl-20210615 text to edit ...
Andy A.'s user avatar
  • 233
2 votes
1 answer
818 views

Suppose I have some files in a folder. I browse the folder using vim vim myfolder. It opens netrw with a list of the files in the directory. Now I want to select two or more files and then open them ...
Ahmad's user avatar
  • 175
0 votes
1 answer
645 views

Basically I need to search only in areas marked red, not pink (in the default color scheme). All I can find is how to search the unfolded areas. This is not very useful to me. I have long lines which ...
n. m. could be an AI's user avatar
2 votes
1 answer
409 views

My idea is that whenever &diff is true for a buffer, I would like some mappings to be active when that buffer is the current buffer. The following attempt works for when I open a session in diff ...
Enlico's user avatar
  • 2,330
4 votes
0 answers
110 views

In diff mode, deleted lines are indicated by a colored block (green below). The 'number' line numbers are skipped for this block. Is it possible to emulate this behavior (screen-width colored blocks ...
dannyadam's user avatar
  • 492
4 votes
1 answer
1k views

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 :...
First User's user avatar
2 votes
1 answer
242 views

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 ...
JDG's user avatar
  • 221
2 votes
0 answers
1k views

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 ...
Dupond's user avatar
  • 45
2 votes
1 answer
388 views

Are there any differences between using vimdiff x.py y.py and vim -d x.py y.py?
WalksB's user avatar
  • 527