diff --git a/src/kakrc b/src/kakrc index e91d5a85..4fc8cd37 100644 --- a/src/kakrc +++ b/src/kakrc @@ -5,3 +5,4 @@ runtime rc/cpp.kak runtime rc/kakrc.kak runtime rc/git.kak runtime rc/global.kak +runtime rc/diff.kak diff --git a/src/rc/diff.kak b/src/rc/diff.kak new file mode 100644 index 00000000..975f73d0 --- /dev/null +++ b/src/rc/diff.kak @@ -0,0 +1,11 @@ +hook global BufCreate .*\.diff \ + setb filetype diff + +hook global WinSetOption filetype=diff \ + addhl group diff-highlight; \ + addhl -group diff-highlight regex "^\+[^\n]*\n" green default; \ + addhl -group diff-highlight regex "^-[^\n]*\n" red default; \ + addhl -group diff-highlight regex "^@@[^\n]*@@" cyan default; + +hook global WinSetOption filetype=(?!diff).* \ + rmhl diff-highlight