Browse Source

new: [docker-host] add ``yaml.nanorc`` for syntax highlighting on nano for yaml files

Boris Gallet 3 weeks ago
committed by Valentin Lab
parent
commit
5a80143e4e
  1. 40
      precise/base-0k/hooks/install.d/30-customize.sh

40
precise/base-0k/hooks/install.d/30-customize.sh

@ -157,3 +157,43 @@ set is hlsearch ai ic scs
nnoremap <esc><esc> :nohls<cr>
EOF
cat <<EOF > /usr/share/nano/yaml.nanorc
## Supports YAML files
syntax "YAML" "\.ya?ml$"
header "^(---|===)" "%YAML"
## Keys
color brightmagenta "^\s*[\$A-Za-z0-9_-]+\:"
color brightmagenta "^\s*@[\$A-Za-z0-9_-]+\:"
## Values
color yellow ":\s.+$"
## 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) "
## Comments
color cyan "#.*$"
## Errors
#color ,red ":\w.+$"
#color ,red ":'.+$"
#color ,red ":".+$"
#color ,red "\s+$"
## Non closed quote
color ,red "['\"][^['\"]]*$"
## Closed quotes
color yellow "['\"].*['\"]"
## Equal sign
color white ":( |$)"
EOF
Loading…
Cancel
Save