rhysd / conflict-marker.vim

Weapon to fight against conflicts in Vim.
488 stars 18 forks source link

Define new syntax regions for advanced highlighting #7

Closed gbcreation closed 5 years ago

gbcreation commented 5 years ago

This PR offers to define additional syntax regions allowing to further customize the highlighting of the different parts of a conflict.

New syntax regions are:

By default the highlight of the ConflictMarkerBegin, ConflictMarkerSeparator and ConflictMarkerEnd regions are a link to the group defined by g:conflict_marker_highlight_group to be compatible with the existing highlighting behavior.

To customize the highlighting of the different parts of a conflict, set g:conflict_marker_highlight_group to '' and define the highlighting of the desired parts.

Example

" disable default highlight links to g:conflict_marker_highlight_group
let g:conflict_marker_highlight_group = ''

" Include text after begin and end markers
let g:conflict_marker_begin = '^<<<<<<< .*$'
let g:conflict_marker_end   = '^>>>>>>> .*$'

highlight ConflictMarkerBegin guibg=#2f7366
highlight ConflictMarkerOurs guibg=#2e5049
highlight ConflictMarkerTheirs guibg=#344f69
highlight ConflictMarkerEnd guibg=#2f628e

Result

Screenshot_20190911_212653

gbcreation commented 5 years ago

README and tests updated.

rhysd commented 5 years ago

Thank you for the updates. I confirmed that CI failure is not related to this PR.

gbcreation commented 5 years ago

Thank you for accepting the PR. As there is a screenshot in README now, maybe issue #4 can be closed ;)