vimdiff

Load different colorscheme when using vimdiff

南笙酒味 提交于 2019-12-02 13:49:42
How to load a different colorscheme when doing vimdiff . I want this because the my current colorscheme does not show some diffs properly in vimdiff , For. eg some diff is shown with same fg/bg color. This makes it very hard to understand the diff. So every time i do a vimdiff i have to do :colorscheme some_other_scheme Can this be done in .vimrc file? If you're calling vimdiff from the command-line, put the following in your .vimrc : if &diff colorscheme some_other_scheme endif If you're using vimdiff from within vim, you'd either have to override the commands you use to start/stop it (e.g.

How can I make git difftool to use gvim (gvimdiff)?

允我心安 提交于 2019-12-01 23:55:20
There seems to have been a change in git which makes it no longer work correctly with gvim as the diff tool. Specifically, I always used to use the gvim -geometry flag to maximize the window. Now, I end up with one of the windows blank (empty/zero line file). OK, I found the answer. In order to work correctly, gvim must stay in the foreground and NOT fork a new process as usual. This is accomplished by using the "-f" or "--nofork" flag when starting gvim (or gvimdiff). I have now setup the following alias which works: alias gitdg='git difftool --noprompt --extcmd="gvim -d --nofork -geometry

DIFF utility works for 2 files. How to compare more than 2 files at a time?

旧巷老猫 提交于 2019-11-30 10:24:10
问题 So the utility Diff works just like I want for 2 files, but I have a project that requires comparisons with more than 2 files at a time, maybe up to 10 at a time. This requires having all those files side by side to each other as well. My research has not really turned up anything, vimdiff seems to be the best so far with the ability to compare 4 at a time. My question: Is there any utility to compare more than 2 files at a time, or a way to hack diff/vimdiff so it can do multiple comparisons

git, vimdiff and dirdiff

帅比萌擦擦* 提交于 2019-11-30 06:38:16
问题 I'm trying to use vimdiff+dirdiff.vim to diff inside Vim multiple files versionned with Git. For Mercurial, it is possible with mercurial extdiff extension. The only way I found on the web to integrate Vim with Git diff is to use vimdiff on a singe file, as describe in this post. Does any one know how to use vimdiff+dirdiff+git? 回答1: Before git version 1.7.11 git-diffall is what I need, thanks a lot. With help of this page about git difftool and this one about running vim+dirdiff from command

DIFF utility works for 2 files. How to compare more than 2 files at a time?

丶灬走出姿态 提交于 2019-11-29 20:14:22
So the utility Diff works just like I want for 2 files, but I have a project that requires comparisons with more than 2 files at a time, maybe up to 10 at a time. This requires having all those files side by side to each other as well. My research has not really turned up anything, vimdiff seems to be the best so far with the ability to compare 4 at a time. My question: Is there any utility to compare more than 2 files at a time, or a way to hack diff/vimdiff so it can do multiple comparisons? The files I will be comparing are relatively short so it should not be too slow. Thanks in advance!

Take diff of two vertical opened windows in Vim

感情迁移 提交于 2019-11-29 19:07:27
I've have two files opened. They are opened in vertical mode, next to next. Can I instantly diff these two files without leaving or closing Vim ? To begin diffing on all visible windows: :windo diffthis which executes :diffthis on each window. To end diff mode: :diffoff! (The ! makes diffoff apply to all windows of the current tab - it'd be nice if diffthis had the same feature, but it doesn't.) in each of the windows you want to diff type: :diffthis If you want to diff all of the open windows, you can do: :windo diffthis ( windo will apply the command to all open windows) Following up on the

git, vimdiff and dirdiff

白昼怎懂夜的黑 提交于 2019-11-28 20:28:37
I'm trying to use vimdiff+ dirdiff.vim to diff inside Vim multiple files versionned with Git. For Mercurial, it is possible with mercurial extdiff extension. The only way I found on the web to integrate Vim with Git diff is to use vimdiff on a singe file, as describe in this post . Does any one know how to use vimdiff+dirdiff+git? user744629 Before git version 1.7.11 git-diffall is what I need, thanks a lot. With help of this page about git difftool and this one about running vim+dirdiff from command line, I wrote my $HOME/.gitconfig as: [diff] tool = default-difftool [difftool "default

(Vim)diff two subroutines in same file

孤街浪徒 提交于 2019-11-28 17:12:20
Is it possible to diff or even vimdiff two almost similar subroutines which occur in the same file? If so, how? I can think of copying the two subroutines in two separate files and then diff them, but is there a way to do it within the original file? Thanks! You cannot do this within the original file, but you can do this without using separate files, only separate buffers. This should work if you copied one subroutine in register a (for example, with "ay typed in visual mode) and other subroutine in register b : enew | call setline(1, split(@a, "\n")) | diffthis | vnew | call setline(1, split

use vimdiff with a diff file

走远了吗. 提交于 2019-11-28 17:11:49
How can I use vimdiff to view the differences described in a diff file? Instead of using /usr/bin/vimdiff command, try this: $ vim file :vertical diffpatch path/to/diff ( :vert diffpa for short.) This is equivalent to calling vimdiff on the original file and the subsequently patched file, but vim calls patch on a temporary file for you. Edit If you want vim 's diff-mode to be entered automatically, use this: $ vim file +'vert diffpa path/to/diff' where +command asks vim to execute "command". ( +123 jumps to line 123, +/abc jumps to the first match for "abc", it's all documented.) Regarding Ken

Is there a way to configure vimdiff to ignore ALL whitespaces?

家住魔仙堡 提交于 2019-11-28 17:09:10
I'm using vim -d file1 file2 in order to see the differences between them. This works fine, but I want to ignore whitespace changes - they are irrelevant for source code files. Vim help states that the following command will do the magic: set diffopt+=iwhite But unfortunately, this command only adds -b to diff tool command line, and that only ignores trailing whitespaces. The correct command line key for diff should be -w , to ignore all whitespace changes. But I can't find how to modify the diff command line directly from Vim. Of course I can compile a custom diff, or replace diff with diff