<p>I've always wanted to be able to get a reasonably elegant way of getting vimdiff to work with a CVS controlled file. I've found numerous (somewhat hacky) scripts around the internet (best example <a href="http://www.vim.org/tips/tip.php?tip_id=390" rel="noreferrer">here</a>) that basically check out the file you are editing from CVS to a temp file, and vimdiff the two. None of these take into account branches, and always assume you're working from MAIN, which for me is completely useless. </p>

<p>So, my question is this: has anyone out there found a decent solution for this that does more than this script?</p>

<p>Or failing that, does anyone have any ideas of how they would implement this, or suggestions for what features you would consider vital for something that does this? My intention is that, if no one can suggest an already built solution to either use or build from, we start building one from here. </p>

[{'answer_id': 26649, 'author': 'Peter Stuifzand', 'author_id': 1633, 'author_profile': 'https://Stackoverflow.com/users/1633', 'pm_score': 0, 'selected': False, 'text': "<p>You could change the call to <code>cvs</code> to take branches into account. That shouldn't be to hard. It bit harder would to change the whole function and make the branch your working a variable (argument, session, global or otherwise).</p>\n"}, {'answer_id': 26708, 'author': 'Greg Hewgill', 'author_id': 893, 'author_profile': 'https://Stackoverflow.com/users/893', 'pm_score': 3, 'selected': True, 'text': '<p>I\'ve been working on a similar script here: <a href="http://github.com/ghewgill/vim-scmdiff" rel="nofollow noreferrer">http://github.com/ghewgill/vim-scmdiff</a> (in fact, they may have the same ancestry). I haven\'t used scmdiff with cvs, but it should do a diff against the branch you have checked out. You can also specify that you want to diff against a particular revision (with :D <em>revision</em>). Hopefully this helps, and feel free to contribute if you\'ve got improvements!</p>\n'}, {'answer_id': 28889, 'author': 'sanmiguel', 'author_id': 24, 'author_profile': 'https://Stackoverflow.com/users/24', 'pm_score': 1, 'selected': False, 'text': "<p>@Greg Hewgill:\nthanks for the script! I had a couple of issues with it though, so here's what I'd change:</p>\n\n<p>line 21:</p>\n\n<pre><code>&lt; map &lt;silent&gt; &lt;C-d&gt; :call &lt;SID&gt;scmToggle()&lt;CR&gt;\n--\n&gt; map &lt;silent&gt; &lt;C-h&gt; :call &lt;SID&gt;scmToggle()&lt;CR&gt;\n</code></pre>\n\n<p>I use <kbd>Ctrl</kbd>-<kbd>d</kbd> for page-down (too lazy to move all that way over to PdDn), so had to switch to Ctrl-h.</p>\n\n<p>line 112:</p>\n\n<pre><code>&lt;         let cmd = 'cd ' . g:scmBufPath . ' &amp;&amp; ' . g:scmDiffCommand . ' diff ' . g:scmDiffRev . ' ' . expand('%:p') . ' &gt; ' . tmpdiff\n--\n&gt; if g:scmDiffUseAbsPaths \n&gt;     let cmd = 'cd ' . g:scmBufPath . ' &amp;&amp; ' . g:scmDiffCommand . ' diff ' . g:scmDiffRev . ' ' . expand('%:p') . ' &gt; ' . tmpdiff\n&gt; else\n&gt;     let cmd = g:scmDiffCommand . ' diff ' . g:scmDiffRev . ' ' . bufname('%') . ' &gt; ' . tmpdiff\n&gt; endif\n</code></pre>\n\n<p>I had issues with not being able to use absolute paths with CVS. I don't know if this is a weirdness of our local set up here, or if  it's a global CVS thing. So, I've made a configurable variable that you can put in your .vimrc to use relative path instead.</p>\n\n<p>It now seems to work exactly how I wanted, so I'll keep bashing away and see if I can find anything else that breaks, posting fixes as I go.</p>\n\n<p>Edit: Forgot to add: please feel free to add these changes to your script on github if you feel they're worthwhile.</p>\n"}, {'answer_id': 1975434, 'author': '0x89', 'author_id': 147058, 'author_profile': 'https://Stackoverflow.com/users/147058', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://www.vim.org/scripts/script.php?script_id=90" rel="nofollow noreferrer">VCSCommand</a> is another actively maintained vim script for VCS integration. It has support for CVS/SVN/SVK/git.</p>\n\n<p>I use it all the time for SVN and never had any complaints. The shortcuts use <a href="http://vimdoc.sourceforge.net/htmldoc/map.html#mapleader" rel="nofollow noreferrer"><code>mapleader</code></a>, so it is unlikely that they will overwrite existing mappings.</p>\n'}]
['https://Stackoverflow.com/questions/26195', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/24/']