Vim svn-diff side view for entire directory

I have a MacVim installation on my OSX machine, so the default Vim application (i.e.: / usr / bin / vim) is actually a symbolic link to the version of Vim command line that ships with MacVim (i.e.: / Applications / MacVim.app/MacOS/vim), as it provides some key advantages over the Vim stock that comes with OSX10.6.

I periodically need to prepare the difference between a set of files and export it to a colorful side-by-side view of an HTML file. This is usually achieved by:

 vim -d file1 file2 (Within Vim): toHTML 

The problem is that I have to manually check the HEAD revision and the specific revision of the two sets of files and perform this operation for each pair of files. It takes a lot of time.

Is it possible for the results of the svn diff be transferred to Vim, so I can have a colorful parallel view for the entire directory (i.e.: PWD), and not just look at the unified diff?

I found several Vim scripts and bash scripts that try to achieve this, but there are two key problems:

  • I want to explicitly call vim -d as a diff tool, not vimdiff , since the MacVim application does not ship with vimdiff , so I would use the wrong version of Vim when the application starts

  • I want multifactor diffs to be generated all over the directory recursively, and not just one or two files at a time.

If this is not possible, perhaps I will create a bash script that will more or less achieve this, but I would like to avoid building a hacked / unreliable script if there is a more effective way to do this.

Thanks.

+1
source share
3 answers

Since then, I have completely resolved this in another, later article of mine. Publish a return URL for future readers:

VIM - Pass a list of colon commands through the command line

0
source

vimdiff is just an alternative name for vim . Binary checks check how it starts and accordingly determines its behavior. (Therefore, there is no other file for gvim and vim .)

On my Mac OS and Linux computers, I created the ~/bin , and then soft links from different names to the macvim binary were created inside it. I put ~/bin very early on my way.

I do not work where I can check to make sure, but I think you can change the default diff svn to point to vimdiff in ~ / .subversion / config. Find the diff-cmd section. fooobar.com/questions/1482274 / ... can also give you useful information.

+2
source

You can try my aurum plugin, it comes with the command :AuVimDiff , which is also able to view all changes in several tabs with the vimdiff section:

 AuVimDiff full HEAD 300 

and get the difference between the two versions without manually having to manually:

 AuVimDiff file file1 HEAD 300 

( file file1 part is optional, it will open diffsplit with the current file, if omitted). All revisions are also optional, since a sub-revision indicating one revision distinguishes it from a file in the working directory and does not indicate any changes, like svn diff : between BASE and the working directory.)

300 here is just an example version.

+1
source

Source: https://habr.com/ru/post/1482272/


All Articles