Tag Info

Hot answers tagged

23

This issue can be caused by the default _vimrc file created by the installer on Windows. If you're still using that default file, or if you copied it at some point, then check the function you've assigned to the diffexpr option. One of the patches between Vim 7.3 and 7.4 introduced new default quoting rules for the cmd.exe shell on Windows. This patch broke ...


21

vimdiff sets foldmethod diff so all unchanged lines are folded. From inside vimdiff you can open all folds by pressing zR. If you would like to always show the full context you could increase the number of unfolded context lines shown to some large number. In your ~/.vimrc: if &diff " only for diff mode/vimdiff set ...


8

There are a number of ways to do this. Select the range of lines in the destination buffer that you want to obtain from the source buffer and use :diffget. For example, you could visually-select a range of lines with V, then type :diffget. Select the range of lines in the source buffer that you want to put into the destination buffer and use :diffput. For ...


7

I see two solutions: you would have to test the current syntax highlighting to jump to the red part in the line. you would have to extract the current line in both buffers and find the first character that differs to position correctly the cursor Both solutions need to be executed after the ]c, and require vim scripting. EDIT: Here is a first draft that ...


6

It sounds like linediff.vim might be what you want: “Perform an interactive diff on two blocks of text”. You specify each block (line range) with its :Linediff command (e.g. :4,10Linediff, or do a visual selection first, then type :Linediff (which comes out as :'<,'>LineDiff)). The ranges can be from the same file/buffer or different ones. Once you ...


5

Vim reads your vimrc once, at startup. The if &diff statement is executed when it is read, not every time the state of 'diff' changes. One way to have those color commands executed when you execute :VCSVimDiff is to put them in an autocommand in your vimrc, like this. au FilterWritePre * if &diff | set t_Co=256 | set bg=dark | colorscheme peaksea | ...


5

I haven't found a really straightforward way to do this, but I've had pretty good success with the NrrrRgn (Narrow Region) plugin, http://www.vim.org/scripts/script.php?script_id=3075. It lets you select a region of a buffer and open that region in a new buffer. You can edit that new buffer and when you close it, the plugin automatically copies your edited ...


4

Thanks to @skarface, I have solved this problem with respect to commiting. First, as I mentioned in the edit to the question, it turned out I was not running Cygwin Git in Cygwin but actual Windows Git. Thus the integration issue makes sense: it is not finding vim or vimdiff. I had to do: git config --global core.editor C:/cygwin/bin/vim.exe I am not ...


4

You could use the vim plugins published here. Then you just need to set the difftool: [multidiff] tool = vd -f As an alternative application I would suggest meld, which will show you modified files - you can then select just the files who's diffs you want to see. See the screenshot here for an example. Further to Marcos useful comment, as a third ...


3

A quite simple workaround is to add this option in your ~/.gitconfig file [difftool] tool = vimdiff $LOCAL $REMOTE prompt = true That way before each file comparison, you are prompted and have the possibility to skip a file by answering 'no' or abort the file comparison with Ctrl+C Example: $ git difftool Viewing: 'file1.js' Launch 'vimdiff' ...


3

This answer to the question on stackoverflow is worth checking. Vimdiff: What are the most frequently used commands/shortcuts that could get a newbie started? in a nutshell: zo and zc to respectively open and close a section zM and zR to respectively expand and fold all the sections


2

This just started happening to me too. I don't know why it's happening, but the way I found to clear it so far is to go into ~/.vim/view and delete the file associated with that filename. I'd love to hear if you found a better way though.


2

This is an easy workaround: You can use set wrap. This will create problems if the difference causes text to wrap in unequal number of lines.


2

I believe you want z+c to close the fold. You can read more by typing :help fold in vim. The following is pasted for convenience: zo Open one fold under the cursor. When a count is given, that many folds deep will be opened. In Visual mode one level of folds is opened for all lines in the selected area. zc Close one ...


2

I also wanted to modify one line at a given moment during a diff. So I created a simple map and put them in my vimrc file. nnoremap <silent> <leader>dp V:diffput<cr> nnoremap <silent> <leader>dg V:diffget<cr> You could use do instead of dg, but I am more used to thinking "diffget" instead of [o]btain. For your bonus, ...


2

Placing the cursor on the line you want to expand and hitting the space bar works for me! It seems like I've had to use the arrow keys sometimes too.


1

Judging by the documentation, it can't be done.


1

Use tar ... -O along with process substitution in bash. diff ... <( tar ... -O ... file.ext ) file.ext


1

I'm not sure what feature you mean, but I think you mean the automatic jumping to the last cursor position described here: :help last-position-jump The autocommand that implements this feature is not part of Vim itself but is often added to /etc/vimrc or /usr/share/vim/vimrc by Linux distributions such as Fedora. If that's the feature you want to disable, ...


1

I've been having the exact same issue. I noticed the following error after executing :diffupdate /bin/bash: /usr/share/vim/vim73diff: No such file or directory That file obviously does not exist so I suspect that @Heptite was correct in saying that vi cannot find a diff binary. diff.exe was already in my PATH though so I'm confused by this. However, ...


1

I can't figure out how to do this with vimdiff either, but you might check out wdiff instead. It shows differences between two files one word at a time. I had to compile it from source: curl http://ftp.gnu.org/gnu/wdiff/wdiff-1.2.1.tar.gz > wdiff-1.2.1.tar.gz tar -xzvf wdiff-1.2.1.tar.gz cd wdiff-1.2.1 ./configure make make install


1

Unfortunately Vim doesn't have explicit diff mode events. You can hack around that to some extent with the suggestions from the other answers. As an alternative to that approach, you can create a function that wraps diffthis and diffoff and change your settings in that function. nnoremap <leader>df :call ToggleDiff()<CR> function! ToggleDiff() ...


1

Did you see the following page? http://versionsapp.com/documentation/versions_wf_comp_customscripts.html This should give you some hints. If not, I'll look into it later, and edit my answer. Edit: Here are detailed instructions. Copy the following script to "~/Library/Application Support/Versions/Compare Scripts" after naming it, e.g. MacVim.sh (beware ...


1

svn log -q -v filename and processing output for revlist svn diff -c M filename for changes in filename in revision M



Only top voted, non community-wiki answers of a minimum length are eligible