Question: Say I get a patch created with `git format-patch`. The file is basically a unified diff with some metadata. If I open the file in Vim, I can see which lines have been modified, but I cannot see which *characters* in the changed lines differ. Does anyone know a way (in Vim, or some other free software that runs on Ubuntu) to visualize per-character differences?

A counter example where per-character diff is visualized is when executing `vimdiff a b`.

**update Fri Nov 12 22:36:23 UTC 2010**

[diffpatch is helpful](https://stackoverflow.com/questions/242646/use-vimdiff-with-a-diff-file/244766#244766) for the scenario where you're working with a single file.

**update Thu Jun 16 17:56:10 UTC 2016**

Check out [diff-highlight in git 2.9](https://github.com/blog/2188-git-2-9-has-been-released). This script does *exactly* what I was originally seeking.

Answer: 
In git, you can merge without committing. Merge your patch first, then do:

```
git diff --word-diff-regex=.

```

Note the dot after the equals sign.
```
git diff --color-words="[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+"

```

The above regex ([from Thomas Rast](http://git.661346.n2.nabble.com/PATCH-1-2-t4034-diff-words-replace-regex-for-diff-driver-td7177053.html)) does a decent job of separating diff fragments at the punctuation/character level (while not being as noisy as `--word-diff-regex=.`). 

I posted a screenshot of the resulting output [here](http://neurotap.blogspot.com/2012/04/character-level-diff-in-git-gui.html).

---

**Update:** 

[This article](http://blogs.atlassian.com/2013/06/git-diff/) has some great suggestions. Specifically, the `contrib/` tree of the git repo has a `diff-highlight` perl script that shows fine-grained highlights. 

Quick start to use it:

```
$ curl https://git.kernel.org/cgit/git/git.git/plain/contrib/diff-highlight/diff-highlight > diff-highlight
$ chmod u+x diff-highlight
$ git diff --color=always HEAD~10 | diff-highlight | less -R

```