# https://www.w3schools.com/sql/default.asp # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # Detection # ‾‾‾‾‾‾‾‾‾ hook global BufCreate .*/?(?i)sql %{ set-option buffer filetype sql } hook -once global BufSetOption filetype=sql %{ require-module sql } provide-module sql %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ add-highlighter shared/sql regions add-highlighter shared/sql/code default-region group add-highlighter shared/sql/double_string region '"' (?|<|>=|<=|<>|\+=|-=|\*=|/=|%=|&=|^-=|\|\*=' 0:operator add-highlighter shared/sql/code/ regex \bNULL\b 0:value add-highlighter shared/sql/code/ regex \b\d+(?:\.\d+)?\b 0:value # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ hook -group sql-highlight global WinSetOption filetype=sql %{ add-highlighter window/sql ref sql hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/sql } } }