2020-04-20 20:15:43 +03:00
|
|
|
## Syntax highlighting for patch and diff files.
|
2014-05-16 15:08:52 +04:00
|
|
|
|
2024-06-08 12:28:06 +03:00
|
|
|
## Original author: Mike Frysinger
|
|
|
|
|
2024-06-02 18:16:22 +03:00
|
|
|
syntax patch "\.(patch|diff|debdiff|rej)$"
|
2017-11-19 13:10:53 +03:00
|
|
|
magic "diff output"
|
2016-05-25 23:13:50 +03:00
|
|
|
# There is no official support for comments in patch files.
|
|
|
|
comment ""
|
2014-05-16 15:08:52 +04:00
|
|
|
|
|
|
|
# Added lines.
|
2006-06-01 21:23:28 +04:00
|
|
|
color brightgreen "^\+.*"
|
2014-05-16 15:08:52 +04:00
|
|
|
# Show trailing whitespace only on added lines.
|
|
|
|
color ,green "[[:space:]]+$"
|
|
|
|
# Context lines.
|
2006-06-01 21:23:28 +04:00
|
|
|
color brightblue "^ .*"
|
2014-05-16 15:08:52 +04:00
|
|
|
# Deleted lines.
|
2006-06-01 21:23:28 +04:00
|
|
|
color brightred "^-.*"
|
2014-05-16 15:08:52 +04:00
|
|
|
|
2016-12-10 19:46:10 +03:00
|
|
|
# Header lines.
|
|
|
|
color magenta "^(Index:|diff)[[:blank:]].*"
|
2014-05-16 15:08:52 +04:00
|
|
|
# File names and dates.
|
2006-06-01 21:23:28 +04:00
|
|
|
color red "^---.*"
|
2014-05-16 15:08:52 +04:00
|
|
|
color green "^\+\+\+.*"
|
|
|
|
# Line numbers.
|
2006-06-01 21:23:28 +04:00
|
|
|
color brightyellow "^@@.*"
|
2016-12-10 19:46:10 +03:00
|
|
|
|
|
|
|
# Statistics.
|
|
|
|
color cyan start="^---$" end="^$"
|