Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
source-highlight's language definition file for YAML
@@ -169,3 +169,5 @@
groovy = groovy.lang
json = json.lang
feature = feature.lang
+yaml = yaml.lang
+yml = yaml.lang
# 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:]]*-'
# - hredoc
# - alias indicators
string delim "\"" "\"" escape "\\"
string delim "'" "'" escape "\\"
# vim: ft=conf

This comment has been minimized.

Copy link

@roko-p roko-p commented Aug 10, 2018

For anyone stumbling upon this by googling; instructions to add this to source-highlight:

  1. Put the yaml.lang file into the dir /usr/local/Cellar/source-highlight/3.1.8_9/share/source-highlight/ or similar

  2. Append those two last lines yaml = yaml.lang and yml = yaml.lang to the file (which is in the same directory)

  3. That's it ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment