1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-25 20:41:49 +03:00

Better elm syntax lighting

this will only highlight elm 0.19 (latest) properly
very close to how https://ellie-app.com/ highlights
- anything that starts with an upper case letter is a type
- anything that starts with a lower case letter is a function
- function declaration is just a function at the start of a line

note: the default color scheme looks too colorful
This commit is contained in:
Leonardo Dias ~Lordie 2019-10-01 23:44:54 -03:00 committed by GitHub
parent d793ca76b6
commit 32648d6cf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,10 +36,15 @@ add-highlighter shared/elm/string region '"' (?<!\\)(\\\\)*" fi
add-highlighter shared/elm/line_comment region (--) $ fill comment
add-highlighter shared/elm/comment region -recurse \{- \{- -\} fill comment
add-highlighter shared/elm/code/ regex (\b)+([A-Z]+[^\s]*) 0:type
add-highlighter shared/elm/code/ regex (\b)+([a-z]+[^\s]*) 0:variable
add-highlighter shared/elm/code/ regex (^[a-z]+[^\s]*) 0:function
add-highlighter shared/elm/code/ regex "-?\b[0-9]*\.?[0-9]+" 0:value
add-highlighter shared/elm/code/ regex \B(\+|\+\+|/|//|-|\*|=|==|&&|\|\||<\||\|>|->)\B 0:operator
add-highlighter shared/elm/code/ regex \b(import|exposing|as|module|where)\b 0:meta
add-highlighter shared/elm/code/ regex \b(True|False)\b 0:value
add-highlighter shared/elm/code/ regex \b(if|then|else|case|of|let|in|type|port|alias)\b 0:keyword
add-highlighter shared/elm/code/ regex \b(Array|Bool|Char|Float|Int|String)\b 0:type
add-highlighter shared/elm/code/ regex (\b(type|alias|if|then|else|case|of|let|in|infix|->)\b)|(\B(:)\B) 0:keyword
# Commands
# ‾‾‾‾‾‾‾‾