2012-07-31 14:22:57 +02:00
|
|
|
hook global BufCreate .*\.(diff|patch) %{
|
2013-10-30 10:38:40 +01:00
|
|
|
set buffer filetype diff
|
2012-07-31 14:22:57 +02:00
|
|
|
}
|
2012-06-27 14:29:12 +02:00
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group / group diff
|
|
|
|
add-highlighter -group /diff regex "^\+[^\n]*\n" 0:green,default
|
|
|
|
add-highlighter -group /diff regex "^-[^\n]*\n" 0:red,default
|
|
|
|
add-highlighter -group /diff regex "^@@[^\n]*@@" 0:cyan,default
|
2012-06-27 14:29:12 +02:00
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
hook -group diff-highlight global WinSetOption filetype=diff %{ add-highlighter ref diff }
|
|
|
|
hook -group diff-highlight global WinSetOption filetype=(?!diff).* %{ remove-highlighter diff }
|