# Detection # ‾‾‾‾‾‾‾‾‾ hook global BufCreate .*[.](jq) %{ set-option buffer filetype jq set-option buffer comment_line '#' set-option buffer extra_word_chars '$' '_' } # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ hook global WinSetOption filetype=jq %{ require-module jq hook -once -always window WinSetOption filetype=.* %{ remove-hooks window jq-.+ } } hook -group jq-highlight global WinSetOption filetype=jq %{ add-highlighter window/jq ref jq hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/jq } } provide-module jq %( # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ add-highlighter shared/jq regions add-highlighter shared/jq/code default-region group add-highlighter shared/jq/string region '"' (? d } } )