Skip to content

Instantly share code, notes, and snippets.

@descention
Created January 25, 2017 18:01
Show Gist options
  • Save descention/8192e9f86258ada919e1525a11ca2cfd to your computer and use it in GitHub Desktop.
Save descention/8192e9f86258ada919e1525a11ca2cfd to your computer and use it in GitHub Desktop.
Nano syntax highlighting for YAML files
## Nano syntax highlighting for YAML files
##
## Author: Leo Arnold
## License: Public Domain
## URL: https://gist.github.com/leoarnold/96272e33753aff09163cf18ad641f028
syntax "yaml" "\.(yml|yaml)$"
## Keys
icolor green "^[[:space:]]*(- )?[.0-9A-Z_/-]+:( |$)"
## Structurals
color red "(^---|^[[:space:]]*- |: |:$)"
## Strings, double-quoted
color red ""([^"]|(\\"))*""
color magenta "\$(\w+|\{\w+\})"
## Strings, single-quoted
color red "'([^']|(\\'))*'"
## Comments
color yellow "(^|[[:space:]]+)#.*$"
## Some common markers
color black,red "(TODO|FIXME|\?\?\?)"
## Trailing spaces
color ,red "[[:space:]]+$"
@descention
Copy link
Author

had to put the hyphen on the end of the block to prevent an invalid end of range error

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