mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-24 03:56:32 +03:00
d49555fc75
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.
15 lines
577 B
Plaintext
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 }
|