Use a reusable diff highlighting group in diff.kak

This commit is contained in:
Maxime Coste 2015-08-24 19:17:50 +01:00
parent 608cc3265e
commit c143d6d203

View File

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