IMEDIFF(1)

NAME
imediff - An interactive fullscreen merge tool for 2 or 3 files

SYNOPSIS

imediff [-a] [-b] [-d] [-f] [-h] [-m] [-n] [-t] [-o file_out] {file_older} {file_newer}

imediff [-a] [-b] [-c] [-d] [-f] [-g] [-h] [-m] [-n] [-t] [-o file_out] {file_yours} {file_base} {file_theirs}

DESCRIPTION

Merge two (slightly different) files with an optional common base file interactively with a user friendly fullscreen interface in the full screen text terminal mode.

imediff shows the differences of given two files (in color if the terminal supports them), lets you scroll the file and toggle changes between older and newer version for each chunk of difference. You can also select line diff and character wdiff mode for display. If you wish to make manual changes, you can edit each chunk with editor. The result of merge operation is saved in file_out.

Additionally, you can customize your choice of editor via $EDITOR or ~/.imediff. The default editor is /usr/bin/editor.

Removed lines are shown in reversed '???' as a placeholder, so you see that and you can select them. While it takes one line on display, it is naturally not saved into the output file.

To see the key binding, hit h in the main imediff screen.

To see the tutorial, hit H in the main imediff screen or simply start the imediff command without arguments.

The program exits with status 0 if the changes were saved, 1 if the merging was aborted and 2 if the parameters were invalid.

OPTIONS

-o file_output, --output=file_output
    Write output to a given file. If missing, STDERR is used.

-m, --mode
    Display mode column.

--mono
    Force monochrome display.

-n
    Non-interactive mode.

-a
    Start with version A (={file_older} or {file_yours}).

-b
    Start with version B (={file_newer} or {file_base}).

-c
    Start with version C (={file_theirs}) for 3 files.

-d
    Start with diff by line between version A and version B for 2 files. (default for 2 files)

    Start with diff by line between version A and version C for 3 files.

-f
    Start with wdiff by character between version A and version B for 2 files.

    Start with wdiff by character between version A and version C for 3 files.

-g
    Set good mode from (a,b,c,e,f) if merged cleanly, or set mode (d) in case of conflicts (default for 3 files).

-h, --help
    Show summary of options and exit.

-t, --template
    Create (or overwrite) ~/.imediff with default values.

-V, --version
    Show version and exit.

KEYBOARD COMMANDS

The following keyboard commands are available in the editor as default.

x
    Save and exit.

q, ctrl+c
    Exit without saving.

home, t, end, z
    , Jump to start or end of chunks.

h
    Show commands.

shift+h
    Show tutorial.

s, ?
    Show the state of the merge.

down, j, up, k
    Move scope of the display for 1 line.

left, right
    Move scope of the display for 1 column.

page up, page down
    Move scope of the display for screenfull lines.

enter
    Toggle mode of display for a selected chunk.

n, space
    Jump to next changed chunk.

N, tab
    Jump to next changed chunk in diff mode (d).

p , backspace
    Jump to previous changed chunk.

P , back-tab
    Jump to previous changed chunk in diff mode (d).

a
    Set mode of the current chunk to display version A.

b
    Set mode of the current chunk to display version B.

c
    Set mode of the current chunk to display version C. (if available)

d
    Set mode of the current chunk to display diff by line.

e
    Set mode of the current chunk to display editor buffer.

f
    Set mode of the current chunk to display wdiff by character.

g
    Set good mode from (a,b,c,e,f) if merged cleanly, or set mode (d) in case of conflicts for the current chunk.

shift+a
    Set mode of all chunks to display version A.

shift+b
    Set mode of all chunks to display version B.

shift+c
    Set mode of all chunks to display version C. (if available)

shift+d
    Set mode of all chunks to display diff by line.

shift+e
    Set mode of all chunks to display editor buffer.

shift+f
    Set mode of all chunks to display wdiff by character.

shift+g
    Set good mode from (a,b,c,e,f) if merged cleanly, or set mode (d) in case of conflicts for all chunks.

m
    Launch external editor on the current chunk.

shift+f
    Remove display editor buffer of the current chunk.

FILE

The key choices of the above keyboard commands can be configured in ~/.imediff which is created at the first execution of this command. The left side is the keys described in this manpage. The right side is your configuration choices. The current settings can be confirmed by the 'h' key dialog.

SEE ALSO

sdiff (1), diff (1), merge (1), diff3 (1).

COPYRIGHT

This manual page as well as the program itself was written by Jarno Elonen <elonen@iki.fi> and Osamu Aoki <osamu@debian.org>. Unlike the program itself, which is licensed under the GNU General Public License (GPL) version 2 (or any later version, at your option), this document has been placed into the Public Domain.

AUTHORS

Jarno Elonen <elonen@iki.fi>
    Original author for 2 file merge in python2

Osamu Aoki <osamu@debian.org>
    Rewrite author for 2 and 3 file merge in python3

COPYRIGHT
Copyright © 2003-2006, 2018 Jarno Elonen <elonen@iki.fi>, Osamu Aoki <osamu@debian.org>