Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7401131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:23:13+00:00 2026-05-29T04:23:13+00:00

Is it possible to get use svn in combination with vim to get a

  • 0

Is it possible to get use svn in combination with vim to get a series of tab pages which contain a diff of each file? It would be a much better alternative to svn diff | view -, but instead of a linear list of diffs it would use vimdiff.

In the past, I have found a way to do this and get svn diff to open multiple vims for each file edited, but being able to go back and review old files would be very useful. Therefore, given a set of tuples of files S, I need a vim shell command which will open each file in the first position of the tuples of S in a different tab page and diff it with the corresponding file in the second position of the tuples in S.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:23:14+00:00Added an answer on May 29, 2026 at 4:23 am

    This can be done with a couple of scripts, and making use of vim’s “server” functionality. The scripts below could be improved a bit, for example it assumes that you want to do this in graphical Vim, and that you don’t want the script to exit until you quit this Vim. Also, the diffs default to using a horizontal split due to using “diffsplit”.

    I do it with the following two scripts. Execute the bash script in the directory you want to run the diff in:

    #!/bin/bash
    
    export VIM_SERVERNAME="SVN-$RANDOM"
    
    # Start up a vim, graphical, in the foreground, but backgrounded...
    vim -g -f --servername "$VIM_SERVERNAME" &
    # So we get can it's PID to wait on later
    gvim_pid=$!
    
    # Wait for the server to start up enough
    sleep 0.5
    
    # Use svn diff to get the right set of files to pass to vimdiff
    svn diff --diff-cmd "vim_tab_diff_helper.py" >/dev/null
    
    # Move to the start of the list; remove the first tab which will be the empty
    # tab
    vim --servername "$VIM_SERVERNAME" --remote-send ":tabfirst<Return>"
    vim --servername "$VIM_SERVERNAME" --remote-send ":bd<Return>"
    
    # Wait for the user to exit vim before returning
    wait $gvim_pid
    

    The helper script “vim_tab_diff_helper.py” is as follows:

    #!/usr/bin/python
    
    import os
    import subprocess
    import sys
    
    def vim_send(command):
      global vim_server
      subprocess.call(['vim', '--servername', vim_server, '--remote-send',
        command + '<Return>'])
    
    vim_server = os.environ['VIM_SERVERNAME']
    svn_orig_file = sys.argv[ len(sys.argv) - 2 ]
    modified_file = sys.argv[ len(sys.argv) - 1 ]
    
    vim_send(":tabnew")
    vim_send(":e " + svn_orig_file)
    vim_send(":diffsplit " + modified_file)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How is it possible to get/use/return a thread from an execute queue ( =
Is it possible to get gdb or use some other tools to create a
Is it possible to get the value from a JavaScript variable and use this
Is it possible to use Java FutureTask with a Spring TaskExecutor to get a
Is it possible to use the .NET configuration objects to get at .config files
Is it possible to use Runtime.getRuntime().exec(cmd.exe); in gwt? When I compile it, I get
Possible Duplicate: Use SVN Revision to label build in CCNET I'm working through the
I want to start use git-svn for a projects which uses a central SVN
Possible Duplicate: What IDE to use for Python? I want to get serious with
Is it possible to use a relative path to an SQLite database file in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.