Skip to content

Instantly share code, notes, and snippets.

@AlexZeitler
Forked from tkfm-yamaguchi/lang.map.diff
Last active February 1, 2023 02:41
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexZeitler/48813447f253360ccc431ae22d6939fd to your computer and use it in GitHub Desktop.
Save AlexZeitler/48813447f253360ccc431ae22d6939fd to your computer and use it in GitHub Desktop.
source-highlight's language definition file for YAML
apt-get install source-highlight
# update .bashrc / .zshrc:
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -R '
# add yaml support as shown in lang.map.diff
---/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
# 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