Created
September 9, 2018 12:10
-
-
Save schickm/ff9ecfdc01ca350b72ba32f80e39c28e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Detection | |
# --------- | |
hook global BufCreate .*\.(hbs) %{ | |
set buffer filetype handlebars | |
} | |
# Highlighters | |
# ------------ | |
add-highlighter shared/handlebars-file regions | |
add-highlighter shared/handlebars-file/html default-region ref html | |
add-highlighter shared/handlebars regions | |
add-highlighter shared/handlebars/comment region '\{\{!--' '\}\}' fill comment | |
add-highlighter shared/handlebars/expression region '\{\{' '\}\}' fill identifier | |
# Initialization | |
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ | |
hook -group handlebars-highlight global WinSetOption filetype=handlebars %{ | |
add-highlighter shared/html/handlebars region '\{\{' '\}\}' ref handlebars | |
add-highlighter shared/html/tag/handlebars region '\{\{' '\}\}' ref handlebars | |
add-highlighter window/handlebars-file ref handlebars-file | |
} | |
hook -group handlebars-highlight global WinSetOption filetype=(?!handlebars).* %{ | |
remove-highlighter shared/html/handlebars | |
remove-highlighter shared/html/tag/handlebars | |
remove-highlighter window/handlebars-file | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment