home/rc/filetype/diff.kak
Alex Leferry 2 c0dccdd90d Add categories in rc/
Closes #2783
2019-03-21 01:06:16 +01:00

14 lines
505 B
Plaintext

hook global BufCreate .*\.(diff|patch) %{
set-option buffer filetype diff
}
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
hook -group diff-highlight global WinSetOption filetype=diff %{
add-highlighter window/diff ref diff
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/diff }
}