From 72787edbc59357088ff645899c04fc30af8648e1 Mon Sep 17 00:00:00 2001 From: "Paulo S. Costa" Date: Mon, 27 Jan 2020 15:18:02 -0800 Subject: [PATCH] Add toml support --- toml.nanorc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 toml.nanorc diff --git a/toml.nanorc b/toml.nanorc new file mode 100644 index 0000000..6b0eedb --- /dev/null +++ b/toml.nanorc @@ -0,0 +1,31 @@ +syntax "toml" "\.toml$" +comment "#" + +# Booleans +color magenta "true|false" + +# Numbers +color green "[+-]?[[:space:]]*[0-9]+(\.[0-9]+)?([Ee][+-]?[0-9]+)?" +color green "[0-9]+(_[0-9]+)*" + +# Tables / unwrapped keys +color brightgreen "[a-zA-Z0-9_]*(\.[a-zA-Z0-9_]+)*" + +# Invalid Table names +color ,red "^[[:space:]]*\[\]" +color ,red "^[[:space:]]*\[[a-zA-Z0-9_]\.\]" +color ,red "^[[:space:]]*\[.*\.\..*\]" +color ,red "^[[:space:]]*\[\..*?\]" + +# Strings +color brightyellow ""(\.|[^"])*"" "'(\.|[^'])*'" +color yellow start="\"\"\"" end="\"\"\"" + +# Comments +color brightblue "#.*" + +# Keyless value +color ,red "^[[:space:]]*=.*" + +# Trailing whitespace +color ,green "[[:space:]]+$"