kakoune/rc/core/diff.kak
Maxime Coste d49555fc75 Move highlighters into Scopes
That means we can now have highlighters active at global, buffer, and
window scope. The add-highlighter and remove-highlighter syntax changed
to take the parent path (scope/group/...) as a mandatory argument,
superseeding the previous -group switch.
2017-10-28 13:43:04 +08:00

12 lines
499 B
Plaintext

hook global BufCreate .*\.(diff|patch) %{
set buffer filetype diff
}
add-highlighter shared/ group diff
add-highlighter shared/diff regex "^\+[^\n]*\n" 0:green,default
add-highlighter shared/diff regex "^-[^\n]*\n" 0:red,default
add-highlighter shared/diff regex "^@@[^\n]*@@" 0:cyan,default
hook -group diff-highlight global WinSetOption filetype=diff %{ add-highlighter window ref diff }
hook -group diff-highlight global WinSetOption filetype=(?!diff).* %{ remove-highlighter window/diff }