Browse Source

new: [docker-host] add yaml.nanorc to handle coloration with yml file in nano

nanoyaml
Boris Gallet 7 months ago
parent
commit
54c5013e5b
  1. 41
      precise/base-0k/hooks/install.d/30-customize.sh

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

@ -157,3 +157,44 @@ set is hlsearch ai ic scs
nnoremap <esc><esc> :nohls<cr>
EOF
protect_pre_install /usr/share/nano/yaml.nanorc
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