Sdif

sdif - side-by-side diff viewer for ANSI terminal

This project is maintained by kaz-utashiro

SDIF

is Side-by-side diff viewer

for ANSI color terminal

capable of word context display powerd by CDIF

default

Flexible color

ANSI 256 colors

green

International

Unicode

East Asian wide width character

Japanese Kanji/Hiragana/Katakana separation

japanese

Korean

korean

Chinese

chinese

Japanese syllable tokenizer

–mecab morphology

mecab

mecab

NAME

sdif - side-by-side diff viewer for ANSI terminal

SYNOPSIS

sdif file_1 file_2

diff … sdif
--number, -n        print line number
--digit=#           set the line number digits (default 4)
--truncate, -t      truncate long line
--onword            fold line on word boundaries
--context, -c, -C#  context diff
--unified, -u, -U#  unified diff

--width=#, -W#      specify width of output (default 80)
--[no]color         use color or not (default on)
--colormap, --cm    specify color map
--colortable        show color table
--[no]256           on/off ANSI 256 color mode (default on)
--mark=position     mark position (right, left, center, side) or no
--view, -v          viewer mode

--man               display manual page
--diff=s            set diff command
--diffopts=s        set diff command options

--cdif              use ``cdif'' as word context diff backend
--cdifopts=s        set cdif command options
--mecab             pass --mecab option to cdif

DESCRIPTION

sdif is inspired by System V sdiff(1) command. The basic feature of sdif is making a side-by-side listing of two different files. All contents of two files are listed on left and right sides. Center column is used to indicate how different those lines. No mark means no difference. Added, deleted and modified lines are marked with `-‘ and `+’ character.

1 deleted  -
2 same          1 same
3 changed  -+   2 modified
4 same          3 same
            +   4 added

It also reads and formats the output from diff command from standard input. Besides normal diff output, context diff -c and unified diff -u output will be handled properly. Combined diff format is also supported, but currently limited up to three files.

Each lines can be displayed in different colors. Read –colormap section in this manual for detail.

While sdif doesn’t care about the contents of each modified lines, it can read the output from cdif command which show the word context differences of each lines. Option –cdif set the appropriate options for cdif. Set –nocc, –nomc options at least when invoking cdif manually. Option –notc is preferable because text color can be handled by sdif.

Environment valuable SDIFOPTS is used to set default options.

OPTIONS

AUTHOR

SEE ALSO