kakoune/rc/base/ini.kak
Maxime Coste d49555fc75 Move highlighters into Scopes
That means we can now have highlighters active at global, buffer, and
window scope. The add-highlighter and remove-highlighter syntax changed
to take the parent path (scope/group/...) as a mandatory argument,
superseeding the previous -group switch.
2017-10-28 13:43:04 +08:00

15 lines
577 B
Plaintext

hook global BufCreate .*\.(repo|service|target|socket|ini|cfg) %{
set buffer filetype ini
}
add-highlighter shared/ regions -default code ini \
comment '(^|\h)\K[#;]' $ ''
add-highlighter shared/ini/code regex "^\h*\[[^\]]*\]" 0:title
add-highlighter shared/ini/code regex "^\h*([^\[][^=\n]*=)([^\n]*)" 1:variable 2:value
add-highlighter shared/ini/comment fill comment
hook -group ini-highlight global WinSetOption filetype=ini %{ add-highlighter window ref ini }
hook -group ini-highlight global WinSetOption filetype=(?!ini).* %{ remove-highlighter window/ini }