From c143d6d203dbc620dc01652fd03c57cd949d395c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 24 Aug 2015 19:17:50 +0100 Subject: [PATCH] Use a reusable diff highlighting group in diff.kak --- rc/diff.kak | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/rc/diff.kak b/rc/diff.kak index b91b0f1e..adab2aa8 100644 --- a/rc/diff.kak +++ b/rc/diff.kak @@ -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 }