TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Icdiff: Side-by-side highlighted command line diffs

112 pointsby stepstopalmost 5 years ago

13 comments

jezalmost 5 years ago
Another little known diff power tool:<p><pre><code> vim -d old.txt new.txt </code></pre> This will open two files in diff mode. You can then use a whole host of fancy keybindings to edit the two files in a diff-aware way (&quot;apply this hunk to that file&quot; &#x2F; manually edit a file and then re-render the diff &#x2F; &quot;fold or expand all non-hunk text&quot; &#x2F; etc.). For more:<p><pre><code> :help diff </code></pre> or see here <a href="https:&#x2F;&#x2F;neovim.io&#x2F;doc&#x2F;user&#x2F;diff.html" rel="nofollow">https:&#x2F;&#x2F;neovim.io&#x2F;doc&#x2F;user&#x2F;diff.html</a>
评论 #23745483 未加载
评论 #23745744 未加载
bno1almost 5 years ago
A similar tool that I really like is meld (<a href="https:&#x2F;&#x2F;meldmerge.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;meldmerge.org&#x2F;</a>). It has a GUI, really nice visual indicators, allows you to view the entire file and directory trees and you can jump between diff chunks using alt + arrow up&#x2F;down.<p>I often use it with git:<p>git difftool -t meld -d
评论 #23747094 未加载
NateEagalmost 5 years ago
Delta is a similar tool with syntax highlighting for most programming languages and customizable themes:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dandavison&#x2F;delta</a><p>It doesn&#x27;t have side-by-side diffs, but it&#x27;s still well worth having around.<p>It&#x27;s a Unix filter, so it works on any unified diff you can come up with.<p>Its default output isn&#x27;t a unified diff, but that&#x27;s easy to fix with its configuration &#x2F; CLI options (I&#x27;m too used to reading unified diffs to like delta&#x27;s simplified default format).
e12ealmost 5 years ago
This looks nice, but is it very different from gnu(?) diff --color=always --side-by-side?
评论 #23749564 未加载
mixmastamykalmost 5 years ago
I&#x27;ve been using `alias diff=colordiff` for maybe twenty years. Looks like icdiff can highlight small changes without needing to call out the whole line. Is there anything else new this one brings?
评论 #23749537 未加载
fphilipealmost 5 years ago
If you&#x27;re used to Git&#x27;s diff view and want to use it for any two files outside of a repo, you can do<p><pre><code> $ git diff --no-index file_a file_b</code></pre>
warkdarrioralmost 5 years ago
colordiff -y [<a href="https:&#x2F;&#x2F;www.colordiff.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.colordiff.org&#x2F;</a>] has similar functionality.
评论 #23745178 未加载
评论 #23749577 未加载
aurahamalmost 5 years ago
This is a really useful utility. This post explains how to use it with mercurial for better diffs:<p><a href="https:&#x2F;&#x2F;ianobermiller.com&#x2F;blog&#x2F;2016&#x2F;07&#x2F;14&#x2F;side-by-side-diffs-for-mercurial-hg-icdiff-revisited&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ianobermiller.com&#x2F;blog&#x2F;2016&#x2F;07&#x2F;14&#x2F;side-by-side-diffs...</a>
pabs3almost 5 years ago
I like diffoscope&#x27;s side-by-side HTML diffs of arbitrary files&#x2F;dirs, for eg:<p><a href="https:&#x2F;&#x2F;diffoscope.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;diffoscope.org&#x2F;</a> <a href="https:&#x2F;&#x2F;diffoscope.org&#x2F;examples&#x2F;https-everywhere-5.0.6_vs_5.0.7.html" rel="nofollow">https:&#x2F;&#x2F;diffoscope.org&#x2F;examples&#x2F;https-everywhere-5.0.6_vs_5....</a>
tutfbhufalmost 5 years ago
I wish Icdiff had syntax highlighting for common programming languages.
评论 #23749612 未加载
评论 #23747112 未加载
yborisalmost 5 years ago
Related: <i>diff2html</i> CLI that will open your browser to a beautifully-rendered HTML diff:<p><a href="https:&#x2F;&#x2F;diff2html.xyz&#x2F;" rel="nofollow">https:&#x2F;&#x2F;diff2html.xyz&#x2F;</a>
zestypingalmost 5 years ago
ydiff might be the tool you&#x27;re looking for.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ymattw&#x2F;ydiff" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ymattw&#x2F;ydiff</a>
评论 #23749863 未加载
splittingTimesalmost 5 years ago
In your experience, What&#x27;s the best tool to check 3-way merge diffs under windows?
评论 #23745265 未加载
评论 #23747848 未加载
评论 #23747906 未加载
评论 #23745340 未加载
评论 #23745385 未加载
评论 #23746204 未加载
评论 #23745718 未加载
评论 #23747512 未加载