# https://smlfamily.github.io # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # Detection # ‾‾‾‾‾‾‾‾‾ hook global BufCreate .*\.(sml|fun|sig) %{ set-option buffer filetype sml } # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ hook global WinSetOption filetype=sml %{ require-module sml set-option buffer extra_word_chars '_' "'" set-option window static_words %opt{sml_static_words} } hook -group sml-highlight global WinSetOption filetype=sml %{ add-highlighter window/sml ref sml hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/sml } } provide-module sml %[ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ add-highlighter shared/sml regions add-highlighter shared/sml/code default-region group add-highlighter shared/sml/string region '#?"' '(?%%&$?`\\#:|]+" 0:operator # Record projection functions add-highlighter shared/sml/code/ regex "(?%%&$?`\\#:|])#([\w']+)?(?![!*/+\-~\^@=<>%%&$?`\\#:|])" 0:function # Symbolic keywords add-highlighter shared/sml/code/ regex "(?%%&$?`\\#:|])(=>|=|\*|->|:>|:|;|\.\.\.|\b_\b|\|)(?![!*/+\-~\^@=<>%%&$?`\\#:|])" 0:keyword # Type variables add-highlighter shared/sml/code/ regex "(?