<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Carbon Silk &#187; diff</title>
	<atom:link href="http://www.carbonsilk.com/tag/diff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.carbonsilk.com</link>
	<description>Developing Ideas by James Broad</description>
	<lastBuildDate>Sun, 20 Mar 2011 00:28:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Using Vim as a diff tool</title>
		<link>http://www.carbonsilk.com/development/vim-diff/</link>
		<comments>http://www.carbonsilk.com/development/vim-diff/#comments</comments>
		<pubDate>Tue, 27 May 2008 17:13:25 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=23</guid>
		<description><![CDATA[Firstly I will start with why to not use diff. I am not suggesting a replacement, I have simply found that Vim offers a much better interface, that is available on most (*nix based) server environments for comparing and merging files side by side. Getting started vim -d file_original.txt file_new.txt Your tool of choice here [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.carbonsilk.com/wp-content/uploads/2008/05/vim-diff.jpg'><img src="http://www.carbonsilk.com/wp-content/uploads/2008/05/vim-diff-300x191.jpg" alt="" title="vim-diff" /></a></p>
<p>Firstly I will start with why to not use <code>diff</code>. I am not suggesting a replacement, I have simply found that Vim offers a much better interface, that is available on most (*nix based) server environments for comparing and merging files side by side.</p>
<h3>Getting started</h3>
<p><code>vim -d file_original.txt file_new.txt</code></p>
<p>Your tool of choice here is <code>vim -d</code>, so if you like this as a &#8216;patch&#8217; to <code>diff</code>, why not be naughty and alias it? I have aliased <code>alias diff='vim -d'</code> in my shell preferences.</p>
<h3>Getting fancy</h3>
<p>Wow, i can see the difference between 2 files, big deal! Try adding more files to the arguments, suddenly we have loads more power to compare multiple files, easily.</p>
<p><code>vim -d file_original.txt file_new.txt file_new_ammendments.txt</code></p>
<h3>Commands</h3>
<p><code>ctrl+ww</code> &#8211; will let you navigate buffers.</p>
<p>When comparing just 2 files, these commands will be handy when you select the lines to merge</p>
<ul>
<li><code>dp</code> &#8211; diff put</li>
<li><code>do</code> &#8211; diff obtain/get</li>
</ul>
<p>If you are in multi diff mode, these may be handy as you need to write long hand commands;</p>
<ul>
<li><code>:diffget 3</code> If you were in buffer 1, writing this command would obtain the difference in buffer 3</li>
<li><code>:diffpu 1</code> Again, write this in buffer 3 and it will place the change in buffer 1</li>
</ul>
<p>Writing/saving changes<br />
<code>:wqall</code></p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://www.vim.org/htmldoc/diff.html">http://www.vim.org/htmldoc/diff.html</a>
<li><a href="http://en.wikipedia.org/wiki/Diff">http://en.wikipedia.org/wiki/Diff</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/vim-diff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

