doc/threesome.txt @ 27f2b1ae4f34

Moar help.
author Steve Losh <steve@stevelosh.com>
date Mon, 13 Jun 2011 14:09:34 -0400
parents 48a4ac7ce632
children 110df92610ac
*threesome.txt*   A plugin for resulving three-way merge conflicts.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

               This plugin is still under active development.

    It is not even remotely ready yet.  Lots of things are unimplemented.

                       It will probably eat your data.

        Seriously. If you use it and complain about it eating your data
                I am going to make fun of you on Twitter.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


Threesome is a Vim plugin for resolving conflicts during three-way merges.
It's designed to be used as a merge tool for version control systems like
Mercurial and Git.

==============================================================================
CONTENTS                                                  *Threesome-contents*

    1. Basic Usage .................... |ThreesomeUsage|
        1.1 Files ..................... |ThreesomeUsage-files|
        1.2 Modes ..................... |ThreesomeUsage-modes|
    2. Key Bindings ................... |ThreesomeKeys|
        2.1 Mode Selection Keys ....... |ThreesomeKeys-mode|
        2.2 File Selection Keys ....... |ThreesomeKeys-file|
        2.3 Other Keys ................ |ThreesomeKeys-other|
    3. Modes .......................... |ThreesomeModes|
        3.1 Grid ...................... |ThreesomeModes-grid|
        3.2 Loupe ..................... |ThreesomeModes-loupe|
        3.3 Compare ................... |ThreesomeModes-compare|
        3.4 Path ...................... |ThreesomeModes-path|
    4. Configuration .................. |ThreesomeConfig|
        4.1 threesome_disable ......... |ThreesomeConfig-disable|
    5. License ........................ |ThreesomeLicense|
    6. Bugs ........................... |ThreesomeBugs|
    7. Contributing ................... |ThreesomeContributing|
    8. Changelog ...................... |ThreesomeChangelog|
    9. Credits ........................ |ThreesomeCredits|

==============================================================================
1. Basic Usage                                                *ThreesomeUsage*

Threesome takes a lot of inspiration for its user interface from Adobe
Lightroom, a photo editing program.

When resolving merge conflicts your goal is:

  - Examine the three files describing the changes being merged.
  - Combine these changes into a fourth file (the "result").
  - Save the result to disk.
  - Exit Vim with a non-error status code to tell the VCS the merge succeeded.

Threesome has several "modes" to help you work with the various files.

------------------------------------------------------------------------------
1.1 Files                                               *ThreesomeUsage-files*

When resolving a merge there are four files you will work with:

Original                                       *ThreesomeUsage-files-original*
    The original file, as it appears in the parent revision of the two
    revisions being merged.

One                                                 *ThreesomeUsage-files-one*
    The file as it appears in the first revision being merged.

    This is usually the "current" revision, or the one you are at when you
    run "hg merge REV").

Two                                                 *ThreesomeUsage-files-two*
    The file as it appears in the second revision being merged.

    This is usually the "target" revision, or the one you specify in the
    "hg merge REV" command).

Result                                           *ThreesomeUsage-files-result*
    The result of merging the two revisions of the file.

    This is the file that your version control system expects to contain the
    final result once you're done.

------------------------------------------------------------------------------
1.2 Modes                                               *ThreesomeUsage-modes*

Threesome has four "modes" or "views" for working with the files.

Grid                                               *ThreesomeUsage-modes-grid*
    Shows all four files at once to give you an overview of the merge.

    See |ThreesomeModes-grid| for more information.

Loupe                                             *ThreesomeUsage-modes-loupe*
    Shows a single file at a time for close examination of a single file.

    See |ThreesomeModes-loupe| for more information.

Compare                                         *ThreesomeUsage-modes-compare*
    Shows two files at a time for examining the movement of changes between
    pairs of files.

    See |ThreesomeModes-compare| for more information.

Path                                               *ThreesomeUsage-modes-path*
    Shows three files at a time:

      - The original
      - Either one or two
      - The result

    Used for examining how a change moves through one "path" or "branch"
    of the merge.

    See |ThreesomeModes-path| for more information.

==============================================================================
2. Key Bindings                                                *ThreesomeKeys*

Threesome makes use of <localleader> for all of its key bindings to avoid
clashing with global mappings. If you've never used <localleader> now
would be a good time to read the |maplocalleader| documentation and
configure a key for it.

All keybindings are used across (almost) all modes.

The behavior of some of them changes depending on the current mode, but the
effects should be fairly intuitive.

------------------------------------------------------------------------------
2.1 Mode Selection Keys                                   *ThreesomeKeys-mode*

<localleader>g                                       *Grid*
                        Switch to grid view.

<localleader>l                                      *Loupe*
                        Switch to loupe view.

<localleader>c                                    *Compare*
                        Switch to compare view.

<localleader>p                                       *Path*
                        Switch to path view.

------------------------------------------------------------------------------
2.2 File Selection Keys                                    *ThreesomeKeys-file*

<localleader>o                                   *Original*
                        Select the original file.

<localleader>1                                        *One*
                        Select file one.

<localleader>2                                        *Two*
                        Select file two.

<localleader>r                                     *Result*
                        Select the result file.

------------------------------------------------------------------------------
2.3 Other Keys                                           *ThreesomeKeys-other*

<localleader>d                                       *Diff*
                        Cycle through various diff combinations.

<localleader>u                                    *UseHunk*
                        Place a hunk from file one or two into
                        the result file.

<localleader>s                                     *Scroll*
                        Toggle scroll locking on and off.

<localleader><space>                               *Layout*
                        Cycle through various layouts of the
                        current view.

<localleader>n                                       *Next*
                        Move to the next unresolved conflict.

<localleader>N                                   *Previous*
                        Move to the previous unresolved conflict.

<localleader>q                                       *Quit*
                        Save the result file and exit Vim.

                        Indicates to the VCS that the merge was
                        successful and it should use the current
                        contents of the result file as the result.

<localleader>CC                                    *Cancel*
                        Exits Vim with an error code (like :cq).
                        Indicates to the VCS that the merge was
                        NOT successful.

==============================================================================
3. Modes                                                      *ThreesomeModes*

This section describes each mode in detail.

------------------------------------------------------------------------------
3.1 Grid                                                 *ThreesomeModes-grid*

The grid view is used to get an overview of all files at once to get a birds'
eye view of the merge.

Grid Layouts
------------

    Layout 1                 Layout 2
    +-------------------+    +--------------------------+
    |     Original      |    | One    | Result | Two    |
    |                   |    |        |        |        |
    +-------------------+    |        |        |        |
    |  One    |    Two  |    |        |        |        |
    |         |         |    |        |        |        |
    +-------------------+    |        |        |        |
    |      Result       |    |        |        |        |
    |                   |    |        |        |        |
    +-------------------+    +--------------------------+

Grid-Specific Key Bindings
--------------------------

<localleader>o                                   *Original*
                        Select the original file, but only in layout 1.

<localleader>u                                    *UseHunk*
                        Disabled in this mode.

<localleader>u1                                  *UseHunk1*
                        Place a hunk from file one into the result file.

<localleader>u2                                  *UseHunk2*
                        Place a hunk from file two into the result file.

Grid Diffs
----------

1. No diff.
2. Diff all files.
3. Diff the original and file one.
4. Diff the original and file two.
5. Diff file one and the result.
6. Diff file two and the result.
7. Diff the original and the result.

------------------------------------------------------------------------------
3.2 Loupe                                               *ThreesomeModes-loupe*

The loupe view is used to focus on and examine a single file in detail.

Loupe Layouts
-------------

    Layout 1
    +-------------------+
    |  Any Single File  |
    |                   |
    |                   |
    |                   |
    |                   |
    |                   |
    |                   |
    |                   |
    +-------------------+

Loupe-Specific Key Bindings
---------------------------

<localleader>u                                    *UseHunk*
                        Disabled in this mode.

Loupe Diffs
-----------

No diffs are possible in loupe mode.

------------------------------------------------------------------------------
3.3 Compare                                           *ThreesomeModes-compare*

The compare view is used to examine the differences between two files at
a time.

Compare Layouts
---------------

    Layout 1                 Layout 2
    +-------------------+    +-------------------+
    | Orig    | Result  |    | Orig              |
    |         |         |    | or One            |
    |    or   |    or   |    | or Two            |
    |         |         |    |                   |
    | One     | One     |    +-------------------+
    |         |         |    | One               |
    |    or   |    or   |    | or Two            |
    |         |         |    | or Result         |
    | Two     | Two     |    |                   |
    +-------------------+    +-------------------+

Compare-Specific Key Bindings
-----------------------------

<localleader>u                                    *UseHunk*
                        If the result file and file one/two are
                        both visible, place a hunk from one/two
                        into the result file.  Otherwise: disabled.

Compare Diffs
-------------

1. No diff.
2. Diff both files.

------------------------------------------------------------------------------
3.4 Path                                                 *ThreesomeModes-path*

The path view is used to view the flow of changed through one "path" or
"branch" of the merge.

Path Layouts
------------

    Layout 1                        Layout 2
    +--------------------------+    +-------------------+
    | Orig   |        | Result |    | Orig              |
    |        |        |        |    |                   |
    |        | One    |        |    |                   |
    |        |        |        |    +-------------------+
    |        |   or   |        |    | One               |
    |        |        |        |    | or Two            |
    |        | Two    |        |    |                   |
    |        |        |        |    +-------------------+
    |        |        |        |    | Result            |
    +--------------------------+    |                   |
                                    |                   |
                                    +-------------------+

Path-Specific Key Bindings
--------------------------

<localleader>u                                    *UseHunk*
                        Place a hunk from file one or two (whichever
                        is currently in the center window) into the
                        result file.

Path Diffs
----------

1. No diff.
2. Diff the original and center windows.
3. Diff the center and result windows.
4. Diff the original and result windows.