From 48fd08c0c21b4552bca6ef69d8d962d2a892b102 Mon Sep 17 00:00:00 2001 From: Boris Gallet Date: Tue, 30 Apr 2024 10:35:56 +0200 Subject: [PATCH] new: [docker-host] add ``yaml.nanorc`` for syntax highlighting on nano for yaml files --- .../base-0k/hooks/install.d/30-customize.sh | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/precise/base-0k/hooks/install.d/30-customize.sh b/precise/base-0k/hooks/install.d/30-customize.sh index da1ac03..3bd9a25 100755 --- a/precise/base-0k/hooks/install.d/30-customize.sh +++ b/precise/base-0k/hooks/install.d/30-customize.sh @@ -157,3 +157,43 @@ set is hlsearch ai ic scs nnoremap :nohls EOF + + +cat < /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 \ No newline at end of file