1. colors in git merge conflicts

    I’m a big user of TextMate and have always liked the very good syntax highlighting support. I just missed colors to help me deal with merge conflicts using git.

    I had difficulties knowing what is the “old” version and what is the “new” one that is in conflict.

    colors !

    I added a few lines to the ruby syntax file for TextMate to have “new” versions in pink and “old” ones in dark yellow:

    merge conflict colors

    candy for everyone

    In order to have the same colorful merge resolution pleasure, you need to add the following lines to the “Ruby” language file in TextMate’s Bundle editor:

    where to insert the new rules for merge conflicts

    where to edit ruby syntax

    rules

            {    name = 'meta.merge.theirs';
                begin = '(^=======\n)';
                end = '(^>>>>>>>.*\n)';
                beginCaptures = { 1 = { name = 'meta.separator.merge'; }; };
                endCaptures = { 1 = { name = 'meta.separator.merge.theirs'; }; };
                patterns = ( { include = '$self'; } );
            },
            {    name = 'meta.merge.mine';
                begin = '(^<<<<<<<.*\n)';
                end = '^(?========)';
                beginCaptures = { 1 = { name = 'meta.separator.merge.mine'; }; };
                patterns = ( { include = '$self'; } );
            },

    theme adaptation

    Then you need to add a few rules for the colors in your theme (TextMate’s preferences):

    merge conflict theme

    I chose the pink for “fresh and newborn” and dark yellow for “old and sunburned”.

    Gaspard Bucher

    comments

    1. Monday, February 16 2009 10:48 hamato-san

      Thanks, I’m going to insert that into my bundle ASAP. Have you thought about submitting it to the Ruby bundle in Macromates’ SVN repository?

    2. leave a comment