home/rc/core/diff.kak

14 lines
513 B
Plaintext
Raw Normal View History

hook global BufCreate .*\.(diff|patch) %{
set-option buffer filetype diff
}
2012-06-27 14:29:12 +02:00
add-highlighter shared/diff group
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
2012-06-27 14:29:12 +02:00
hook -group diff-highlight global WinSetOption filetype=diff %{
add-highlighter window/diff ref diff
hook -once -always window WinSetOption filetype=(?!diff).* %{ remove-highlighter window/diff }
}