From 46dab2c1f38f8ed7d0fda420644f9af3a6c9affd Mon Sep 17 00:00:00 2001 From: Paul Seitz Date: Sat, 5 Nov 2016 14:09:25 +0000 Subject: [PATCH] syntax: added nix.nanorc --- doc/syntax/nix.nanorc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 doc/syntax/nix.nanorc diff --git a/doc/syntax/nix.nanorc b/doc/syntax/nix.nanorc new file mode 100644 index 0000000..f262dcf --- /dev/null +++ b/doc/syntax/nix.nanorc @@ -0,0 +1,55 @@ +syntax "nix" "\.nix$" + +#numbers & bools +color magenta "( |=|:|\[|\(|,)[0-9]+(;| |\]|\)|$|,)" +#color magenta "[ |=|:][ ]*[0-9]+$" +color magenta " [0-9]+ " +color magenta "( )(true|false|null)(;| |\]|\)|$)" + +#bashstuff +icolor brightgreen "^[0-9A-Z_]+\(\)" +color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>" +color green "\<(declare|eval|exec|export|let|local)\>" +color green "[{}():;|`$<>!=&\\?]" "(\]|\[)" +color green "\+\+" +color green "-[Ldefgruwx]\>" +color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>" +color brightblue "\<(awk|cat|cd|ch(grp|mod|own)|cp|echo|env|grep|install|ln|make|mkdir|mv|popd|printf|pushd|rm|rmdir|sed|set|tar|touch|umask|unset)\>( |$)" + +#nixstuff +color green "(abort|import|inherit|with|or|rec|assert)( |$)" + +#Strings. +color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'" + +icolor brightyellow start="description =[ ]*''" end="'';" +icolor brightyellow start="description =[ ]*$" end="'';" + +#Url +icolor yellow " url =.*" +icolor yellow "homepage =.*" + +#Remove Color from these: +icolor white "description =" +icolor white " url =" +icolor white "homepage =" + +#embedet nixstuff +color green "=|;|}" +color brightred "\$\{[^\}]*\}" +color brightyellow "\"|'" + +# Bash basic variable names (no braces). +color brightred "address@hidden" "\$[[:alpha:]_][[:alnum:]_]*" + +# Bash more complicated variable names; handles braces and replacements and arrays. +color brightred "\$\{[#!]?(address@hidden|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})" + + +# Comments. +color cyan "(^|[[:space:]])#.*$" +color cyan start="/\*" end="\*/" + +# Trailing whitespace. +#color ,green "[[:space:]]+$" + -- 1.9.4