From 54c5013e5b1cfe622a4e383b6d1f07fb79065eb8 Mon Sep 17 00:00:00 2001 From: Boris Gallet Date: Wed, 24 Apr 2024 16:08:30 +0200 Subject: [PATCH] new: [docker-host] add yaml.nanorc to handle coloration with yml file in nano --- .../base-0k/hooks/install.d/30-customize.sh | 41 +++++++++++++++++++ 1 file changed, 41 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..ab0ee90 100755 --- a/precise/base-0k/hooks/install.d/30-customize.sh +++ b/precise/base-0k/hooks/install.d/30-customize.sh @@ -157,3 +157,44 @@ set is hlsearch ai ic scs nnoremap :nohls 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 \ No newline at end of file -- 2.30.2