Last active
February 5, 2024 19:51
-
-
Save tkfm-yamaguchi/c4952b355bb7a27552a5f23e0c53b65f to your computer and use it in GitHub Desktop.
source-highlight's language definition file for YAML
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
---/usr/share/source-highlight/lang.map.old | |
+++/usr/share/source-highlight/lang.map | |
@@ -169,3 +169,5 @@ | |
groovy = groovy.lang | |
json = json.lang | |
feature = feature.lang | |
+yaml = yaml.lang | |
+yml = yaml.lang |
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
# source-highlight's language definition file for YAML | |
include "script_comment.lang" | |
include "number.lang" | |
keyword = "true|false|null" | |
section start '^---' | |
(symbol,name,symbol) = `(^[[:blank:]-]*)([[:alnum:]_]+)(:)` | |
symbol = '^[[:blank:]]*-' | |
# TODO: | |
# - hredoc | |
# - alias indicators | |
string delim "\"" "\"" escape "\\" | |
string delim "'" "'" escape "\\" | |
# vim: ft=conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For anyone stumbling upon this by googling; instructions to add this to
source-highlight
:Put the
yaml.lang
file into the dir/usr/local/Cellar/source-highlight/3.1.8_9/share/source-highlight/
or similarAppend those two last lines
yaml = yaml.lang
andyml = yaml.lang
to thelang.map.diff
file (which is in the same directory)That's it ✔️