vimdiff

vimdiff E97 in Powershell

时光怂恿深爱的人放手 提交于 2019-12-05 10:36:58
I am having trouble getting vimdiff to work on a Windows 10 machine. I am running vim from Powershell. Powershell is also declared in $myvimrc as my shell of choice: set shell=C:\WINDOWS\system32\WindowsPowershell\v1.0\powershell.exe The documents I am attempting to compare are not saved as files. I open two vertical splits, enter text into each, and run :windo diffthis . The output is E97: Cannot create diffs . This article says I may need to download and use a different diff.exe than the one installed with gvim. I have downloaded the recommended "GnuWin32 diff" package and added the install

How to ignore some differences in diff command?

瘦欲@ 提交于 2019-12-04 15:13:05
问题 diff has an option -I regexp , which ignores changes that just insert or delete lines that match the given regexp. I need an analogue of this for the case, when changes are between two lines (rather then insert or delete lines). For instance, I want to ignore all differences like between "abXd" and "abYd" , for given X and Y . It seems diff has not such kind of ability. Is there any suitable alternative for diff ? 回答1: You could filter the two files through sed to eliminate the lines you don

How do you exit vimdiff mode in vim, specifically, for Fugitive?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 07:37:48
问题 I am using vim with the fugitive extension. It has a :Gdiff command which brings you into vimdiff mode, but what is the right/quick way to close/quit vimdiff mode? I.e., let's say I am editing the file FooBar.txt under Git repository. I fire up :Gdiff, review my changes in vimdiff, and then I want to get back and continue editing FooBar.txt or any other file :) UPDATE1: I'm going to give these quick combos a try next working day :) "vimdiff current vs git head (fugitive extension) nnoremap

Load different colorscheme when using vimdiff

好久不见. 提交于 2019-12-04 07:21:15
问题 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? 回答1: If you're calling vimdiff from the command-line, put the following in your .vimrc : if &diff colorscheme some_other_scheme endif If you

Vimdiff: How to put all changes inside a particular function from one file to another?

…衆ロ難τιáo~ 提交于 2019-12-04 03:21:48
In Vimdiff, I know I can use "do" or "dp" to move changes from one file to the other...but these are for individual changes. If I have to undo all changes inside a specific scope/selection (say undo all changes to a particular function, but leave the rest untouched), is there a way to do it in one go ? You can use a visual selection and the ex command :diffget / :diffput So, for example to get the changes for just the current insides of a code block ( { ... } ) Vi}:diffget<Enter> To put the changes for the two enclosing levels including the lines with the brackets: V2a}:diffput<Enter> Note

Getting gVim's vimdiff to ignore case

微笑、不失礼 提交于 2019-12-04 01:26:18
I am trying to compare two assembly files where one was written all caps and the other in lowercase. Many lines are identical up to case and whitespace. I tried the following, while two buffers in diff mode: :set diffopt+=icase :set diffopt+=iwhite :diffupdate The whitespace thing seems to work well, but the ignore case does not do its work. For example, in the following two lines: I0=R0; // ADDRESS OF INPUT ARRAY i0 = r0; // address of input array [the first line begins with 12 spaces, the second with a single tab] Why? What can I do? UPDATE: just noticed that in these two lines all

vimdiff: force line-by-line comparison (ignore supposedly missing/additional lines)

做~自己de王妃 提交于 2019-12-04 01:01:31
How do I force vimdiff to always compare two files line-by-line without identifying added or deleted lines? The problem is that if the diff between two files is large, but by chance two lines in the file match up, vimdiff thinks these lines are the same and just treats the rest as added or deleted lines, and the resulting diff is totally unusable. In my case, line i in file1 always corresponds to line i in file2, so vimdiff has no business finding added or deleted lines. Following is a small example with two files containing the values of two variables three times each. Vimdiff erroneously

Why does git mergetool opens 4 windows in vimdiff? (I'd expect 3)

不羁岁月 提交于 2019-12-03 01:43:14
问题 When I met a conflict, I tried to use git-mergetool to solve it. I typed: >git mergetool -t vimdiff It opened vimdiff in 4-way, not 3-way. My split windows in vimdiff look like: :ls 1 #a "Gemfile.lock" line 1 2 %a "Gemfile.lock.LOCAL.4828.lock" line 1 3 a "Gemfile.lock.BASE.4828.lock" line 0 4 a "Gemfile.lock.REMOTE.4828.lock" line 0 What are they? I want a 3-way diff: target file, merge file and working file. How should I configure my git or vimdiff? 回答1: As an alternative, have you thought

How do I toggle between a Vertical and a Horizontal split in vimdiff?

三世轮回 提交于 2019-12-02 20:03:12
I already know how to use the diffopt variable to start diff mode with horizontal/vertical splits but not how to toggle between the two when I already have two files open for comparison. I tried the accepted answer found in this older post , but to no avail. The Ctrl+W commands didn't work for me. Perhaps because I'm running gVim in Windows-friendly mode? The following command will change a vertical split into a horizontal split: ctrl + w then J To change back to a vertical split use either: ctrl + w H or ctrl + w L For more information about moving windows: :h window-moving :h ctrl-w_J :h

Why does git mergetool opens 4 windows in vimdiff? (I'd expect 3)

安稳与你 提交于 2019-12-02 15:13:36
When I met a conflict, I tried to use git-mergetool to solve it. I typed: >git mergetool -t vimdiff It opened vimdiff in 4-way, not 3-way. My split windows in vimdiff look like: :ls 1 #a "Gemfile.lock" line 1 2 %a "Gemfile.lock.LOCAL.4828.lock" line 1 3 a "Gemfile.lock.BASE.4828.lock" line 0 4 a "Gemfile.lock.REMOTE.4828.lock" line 0 What are they? I want a 3-way diff: target file, merge file and working file. How should I configure my git or vimdiff? As an alternative, have you thought about using fugitive ? I'm not going to lie to you; fugitive.vim may very well be the best Git wrapper of