Created
September 2, 2017 08:36
-
-
Save belisarius222/f70e325d781e9f0f8d3947571615c7d1 to your computer and use it in GitHub Desktop.
hoon syntax highlighting for kakoune
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 .*[.](hoon) %{ | |
set buffer filetype hoon | |
} | |
# Highlighters & Completion | |
# | |
add-highlighter -group / regions -default code hoon \ | |
doq '"' (?<!\\)(\\\\)*" '' \ | |
soq "'" (?<!\\)(\\\\)*' '' \ | |
scol '::' '$' '' \ | |
slus "\+\+\s(\s+)(\w|\-|\d)+" \s '' | |
add-highlighter -group /hoon/soq fill string | |
add-highlighter -group /hoon/doq fill string | |
add-highlighter -group /hoon/scol fill comment | |
add-highlighter -group /hoon/slus fill function | |
# Terms, constants, etc. | |
add-highlighter -group /hoon/code regex \%(\w|\-|\d)+ 0:value 1:value | |
add-highlighter -group /hoon/code regex \$(\w|\-|\d)+ 0:keyword 1:keyword | |
# Initialization | |
# | |
hook -group hoon-highlight global \ | |
WinSetOption filetype=hoon %{ add-highlighter ref hoon } | |
hook -group hoon-highlight global WinSetOption \ | |
filetype=(?!hoon).* %{ remove-highlighter hoon } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment