Created
October 21, 2021 05:42
-
-
Save csloz/8d2700fa63669a6419b469fcd518f942 to your computer and use it in GitHub Desktop.
Custom docker/ yml colouring for nano
This file contains hidden or 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
#Create a custom yml colour scheme for nano | |
sudo tee /usr/share/nano/yaml.nanorc <<EOF >> /dev/null | |
# Supports files | |
syntax "YAML" "\.ya?ml$" | |
## Keywords | |
icolor red "^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD)[[:space:]]" | |
## Brackets & parenthesis | |
color brightgreen "(\(|\)|\[|\])" | |
## Double ampersand | |
color brightmagenta "&&" | |
## Comments | |
icolor cyan "^[[:space:]]*#.*$" | |
## Blank space at EOL | |
color ,green "[[:space:]]+$" | |
## Strings, single-quoted | |
color brightwhite "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" | |
## Strings, double-quoted | |
color brightwhite ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!" | |
## Single and double quotes | |
color brightyellow "('|\")" | |
## Booleans | |
icolor brightcyan " (y|yes|n|no|true|false|on|off)$" | |
## Numbers | |
color brightred " [[:digit:]]+(\.[[:digit:]]+)?" | |
## Arrays | |
color red "\[" "\]" ":\s+[|>]" "^\s*- " | |
## Reserved | |
color green "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) " | |
## Closed quotes | |
color yellow "['\"].*['\"]" | |
## Equal sign | |
color brightgreen ":( |$)" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment