-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnix.nanorc
60 lines (45 loc) · 6.87 KB
/
nix.nanorc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
syntax "nix" "\.nix$"
#numbers & bools
color brightmagenta "( |=|:|\[|\(|,)[0-9]+(;| |\]|\)|$|,)"
#color magenta "[ |=|:][ ]*[0-9]+$"
color brightmagenta " [0-9]+ "
color brightmagenta "( )(true|false|null)(;| |\]|\)|$)"
#colorize lib.functions
color magenta "(^| |\(|[|{|}|]|\))(fixMergeModules|mapAttrsRecursiveCond|removePrefix|add|fixedPoints|mapAttrsToList|removeSuffix|addContextFrom|fixedWidthNumber|mapDerivationAttrset|replaceChars|addErrorContext|fixedWidthString|mapNullable|replaceStrings|addErrorContextToAttrs|fixupOptionType|matchAttrs|reverseList|addMetaAttrs|flatten|max|runTests|all|flip|maybeAttr|scrubOptionValue|and|fold|maybeAttrNullable|seq|any|foldArgs|maybeEnv|setAttr|appendToName|foldAttrs|mergeAttrBy|setAttrByPath|applyIfFunction|foldl|mergeAttrByFunc|setAttrMerge|attrByPath|foldl'|mergeAttrs|setFunctionArgs|attrNames|foldr|mergeAttrsByFuncDefaults|setName|attrNamesToStr|fullDepEntry|mergeAttrsByFuncDefaultsClean|setType|attrVals|functionArgs|mergeAttrsConcatenateValues|showFiles|attrValues|genAttrs|mergeAttrsNoOverride|showOption|attrsets|genList|mergeAttrsWithFunc|showVal|bitAnd|generators|mergeDefaultOption|singleton|bitNot|genericClosure|mergeDefinitions|sort|bitOr|getAttr|mergeEqualOption|sortProperties|bitXor|getAttrFromPath|mergeModules|sourceByRegex|boolToString|getBin|mergeModules'|sourceFilesBySuffices|callPackageWith|getDev|mergeOneOption|sources|callPackagesWith|getFiles|mergeOptionDecls|splitByAndCompare|canCleanSource|getLib|meta|splitString|catAttrs|getOutput|min|stringAfter|checkFlag|getValue|misc|stringAsChars|checkReqs|getValues|mkAfter|stringLength|chooseDevOutputs|getVersion|mkAliasAndWrapDefinitions|stringToCharacters|cleanSource|groupBy|mkAliasDefinitions|strings|cleanSourceFilter|groupBy'|mkAliasOptionModule|stringsWithDeps|cleanSourceWith|hasAttr|mkAssert|sub|closeModules|hasAttrByPath|mkBefore|sublist|closePropagation|hasPrefix|mkChangedOptionModule|substring|collect|hasSuffix|mkDefault|subtractLists|commitIdFromGitRepo|head|mkEnableOption|systems|compare|hiPrio|mkFixStrictness|tail|compareLists|hiPrioSet|mkForce|take|composeExtensions|hydraJob|mkIf|testAllTrue|composedArgsAndFun|id|mkMerge|textClosureList|concat|ifEnable|mkMergedOptionModule|textClosureMap|concatImapStrings|imap|mkOption|toDerivation|concatImapStringsSep|imap0|mkOptionDefault|toInt|concatLists|imap1|mkOptionType|toList|concatMap|importJSON|mkOrder|toLower|concatMapStrings|inNixShell|mkOverride|toUpper|concatMapStringsSep|info|mkRemovedOptionModule|toposort|concatStrings|init|mkRenamedOptionModule|traceCall|concatStringsSep|innerClosePropagation|mkSinkUndeclaredOptions|traceCall2|condConcat|innerModifySumArgs|mkStrict|traceCall3|const|intersectLists|mkVMOverride|traceCallXml|count|intersperse|mod|traceIf|crossLists|isAttrs|modifySumArgs|traceSeq|customisation|isBool|modules|traceSeqN|debug|isDerivation|mutuallyExclusive|traceShowVal|deepSeq|isFunction|nameFromURL|traceShowValMarked|defaultFunctor|isInt|nameValuePair|traceVal|defaultMerge|isList|naturalSort|traceValFn|defaultMergeArg|isOption|nixType|traceValIfNot|defaultOverridableDelayableArgs|isOptionType|nixpkgsVersion|traceValSeq|defaultTypeMerge|isStorePath|noDepEntry|traceValSeqFn|dischargeProperties|isString|nvs|traceValSeqN|doRename|isType|optionAttrSetToDocList|traceValSeqNFn|dontDistribute|last|optionAttrSetToDocList'|traceXMLVal|drop|lazyGenericClosure|optional|traceXMLValMarked|elem|length|optionalAttrs|trivial|elemAt|lessThan|optionalString|types|enableFeature|licenses|optionals|unifyModuleSyntax|enableFeatureAs|listDfs|options|uniqList|escape|listToAttrs|or|uniqListExt|escapeShellArg|lists|overridableDelayableArgs|unique|escapeShellArgs|literalExample|overrideDerivation|unknownModule|evalModules|lowPrio|overrideExisting|unpackSubmodule|evalOptionValue|lowPrioSet|packEntry|updateName|extend|lowerChars|packSubmodule|upperChars|extendDerivation|maintainers|partition|version|extends|makeBinPath|pathExists|versionAtLeast|fetchers|makeExtensible|pathHasContext|versionOlder|fileContents|makeExtensibleWithCustomName|pathIsDirectory|versions|filesystem|makeLibraryPath|pathType|warn|filter|makeOverridable|platforms|withFeature|filterAttrs|makePerlPath|prepareDerivationArgs|withFeatureAs|filterAttrsRecursive|makeScope|pushDownProperties|zip|filterModules|makeSearchPath|range|zipAttrs|filterOverrides|makeSearchPathOutput|readFile|zipAttrsWith|findFirst|mapAttrs|readPathsFromFile|zipAttrsWithNames|findSingle|mapAttrs'|recursiveUpdate|zipLists|fix|mapAttrsFlatten|recursiveUpdateUntil|zipListsWith|fix'|mapAttrsRecursive|remove|zipWithNames)( |$)"
#colorize builtins.functions
color magenta "(^| |\(|[|{|}|]|\))(abort|functionArgs|pathExists|add|genList|placeholder|addErrorContext|genericClosure|readDir|all|getAttr|readFile|any|getEnv|removeAttrs|attrNames|hasAttr|replaceStrings|attrValues|hasContext|scopedImport|baseNameOf|hashString|seq|head|sort|catAttrs|import|split|compareVersions|intersectAttrs|splitVersion|concatLists|isAttrs|storeDir|concatStringsSep|isBool|storePath|currentSystem|isFloat|stringLength|currentTime|isFunction|sub|deepSeq|isInt|substring|derivation|isList|tail|derivationStrict|isNull|throw|dirOf|isString|toFile|div|langVersion|toJSON|elem|length|toPath|elemAt|lessThan|toString|false|listToAttrs|toXML|fetchGit|map|trace|fetchMercurial|match|true|fetchTarball|mul|tryEval|fetchurl|nixPath|typeOf|filter|nixVersion|unsafeDiscardOutputDependency|filterSource|null|unsafeDiscardStringContext|findFile|parseDrvName|unsafeGetAttrPos|foldl'|partition|valueSize|fromJSON|path)( |$)"
#nix stuff
color green "=|;|}|\."
color green "(abort|import|inherit|with|or|rec|assert)( |$)"
#nix strings
color yellow "\"|'"
#Url
icolor yellow " url =.*"
icolor yellow "homepage =.*"
#Make atributenames grey
color white ".* =( |$)"
#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)\>( |$)"
#Strings.
color yellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
icolor yellow start="description =[ ]*''" end="'';"
icolor yellow start="description =[ ]*$" end="'';"
icolor white "description ="
#embedet nixstuff
color brightred "\$\{[^\}]*\}"
# Bash basic variable names (no braces).
color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
# Bash more complicated variable names; handles braces and replacements and arrays.
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:space:]]*[[:alnum:]_]+[[:space:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
# Comments.
color cyan "(^|[[:space:]])#.*$"
color cyan start="/\*" end="\*/"
# Trailing whitespace.
color green "[[:space:]]+$"