Use a reusable diff highlighting group in diff.kak
This commit is contained in:
parent
608cc3265e
commit
c143d6d203
15
rc/diff.kak
15
rc/diff.kak
|
@ -2,13 +2,10 @@ hook global BufCreate .*\.(diff|patch) %{
|
||||||
set buffer filetype diff
|
set buffer filetype diff
|
||||||
}
|
}
|
||||||
|
|
||||||
hook global WinSetOption filetype=diff %{
|
addhl -group / group diff
|
||||||
addhl group diff-highlight
|
addhl -group /diff regex "^\+[^\n]*\n" 0:green,default
|
||||||
addhl -group diff-highlight regex "^\+[^\n]*\n" 0:green,default
|
addhl -group /diff regex "^-[^\n]*\n" 0:red,default
|
||||||
addhl -group diff-highlight regex "^-[^\n]*\n" 0:red,default
|
addhl -group /diff regex "^@@[^\n]*@@" 0:cyan,default
|
||||||
addhl -group diff-highlight regex "^@@[^\n]*@@" 0:cyan,default
|
|
||||||
}
|
|
||||||
|
|
||||||
hook global WinSetOption filetype=(?!diff).* %{
|
hook global WinSetOption filetype=diff %{ addhl ref diff }
|
||||||
rmhl diff-highlight
|
hook global WinSetOption filetype=(?!diff).* %{ rmhl diff }
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user