Skip to content

Instantly share code, notes, and snippets.

@ltning
Created March 25, 2018 14:55
Show Gist options
  • Save ltning/8bdb8d0390128a7c22878c29ca2052fe to your computer and use it in GitHub Desktop.
Save ltning/8bdb8d0390128a7c22878c29ca2052fe to your computer and use it in GitHub Desktop.
nano syntax highlighting for yaml
## Nano syntax highlighting for YAML files
##
## Author: Leo Arnold
## Modified by: Eirik Oeverby
## License: Public Domain
## URL: https://gist.github.com/leoarnold/96272e33753aff09163cf18ad641f028
syntax "yaml" "\.(yml|yaml)$"
## Keys
#icolor green "^[[:space:]]*(- )?[.0-9A-Z_/-]+:( |$)"
icolor white "^[[:space:]]*[.0-9a-zA-Z_/-:]+:( |$)"
color green "(::)"
color brightwhite "[.0-9a-zA-Z_/-]+:( |$)"
## Structurals
color brightred "(^---|^[[:space:]]*- |: |:$)"
## Strings, double-quoted
color brightgreen ""([^"]|(\\"))*""
color brightgreen "\$(\w+|\{\w+\})"
## Strings, single-quoted
color green "'([^']|(\\'))*'"
## Variables
color yellow "%\{.*?\}"
## Functions
color brightyellow "(%\{.*?\(|\).*?\})"
## Comments
color cyan "(^|[[:space:]]+)#.*$"
## Some common markers
color brightcyan "(TODO|FIXME|\?\?\?)"
## Trailing spaces
color ,red "[[:space:]]+$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment