toys

Tools and things that make my life easier - y'all might like them too

View the Project on GitHub pfuntner/toys

side-diff

Purpose

This script leverages the diff --side-by-side option but its biggest strength is the ability to automatically detect the width of the shell window and adjust the output to fit the screen.

Syntax

Syntax: side-diff [--verbose] [--wide] [--width WIDTH] [--ignore-space-change] file1 file2

Options and arguments

| Option | Description | Default | |——————————-|————————————————————|——————————————-| | --wide | Use the entire width of the screen | diff has a default width it will use | | --width WIDTH | The specified width is used, regardless of the screen size | diff has a default width it will use | | -b, --ignore-space-change | Ignore changes in whitespace | Differences in whitespace are not ignored | | -v | Enable verbose debugging | Debugging is not enabled |

Example

I will use a command like the following:

$ side-diff --wide <(git-cat master README.md) README.md | more-head

git-cat and more-head are other tools of mine in this repository.

Default width

default-width

Zoomed in

zoomed-in

Notes