Vim regex for git merge conflicts

Viewed 733

Im making a plugin that will add syntax groups for files with merge conflicts in vim.

An example conflict is shown below.

<<<<<<< HEAD
ourselves
=======
themselves
>>>>>>> deadbeef0123

The current regex for the <<<<<<< HEAD to ======= is working correctly.

syntax region conflictHead containedin=ALL start=/^<<<<<<< \@=/ end=/^=\@=/

But Im stuck trying to get the right regex for everything after =======

syntax region conflictMerge containedin=ALL start=/^=======$\@<!/ end=/^>>>>>>> \@=/

enter image description here

The regex should get everything after the separator and up until the commit sha.

Any tips/pointers?

1 Answers
Related