gentoo.nanorc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ## Here is an example for ebuilds/eclasses
  2. ##
  3. syntax "ebuild" "\.e(build|class)$"
  4. ## All the standard portage functions
  5. color brightgreen "^src_(unpack|compile|install|test)" "^pkg_(config|nofetch|setup|(pre|post)(inst|rm))"
  6. ## Highlight bash related syntax
  7. color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while|continue|break)\>"
  8. color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
  9. color green "-(e|d|f|r|g|u|w|x|L)\>"
  10. color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
  11. ## Highlight variables ... official portage ones in red, all others in bright red
  12. color brightred "\$\{?[a-zA-Z_0-9]+\}?"
  13. color red "\<(ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)\>"
  14. color red "\<(S|D|T|PV|PF|P|PN|A)\>" "\<C(XX)?FLAGS\>" "\<LDFLAGS\>" "\<C(HOST|TARGET|BUILD)\>"
  15. ## Highlight portage commands
  16. color magenta "\<use(_(with|enable))?\> [!a-zA-Z0-9_+ -]*" "inherit.*"
  17. color brightblue "\<e(begin|end|conf|install|make|warn|infon?|error|log|patch|new(group|user))\>"
  18. color brightblue "\<die\>" "\<use(_(with|enable))?\>" "\<inherit\>" "\<has\>" "\<(has|best)_version\>" "\<unpack\>"
  19. color brightblue "\<(do|new)(ins|s?bin|doc|lib(\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)\>"
  20. color brightblue "\<do(python|sed|dir|hard|sym|html|jar|mo)\>" "\<keepdir\>"
  21. color brightblue "prepall(docs|info|man|strip)" "prep(info|lib|lib\.(so|a)|man|strip)"
  22. color brightblue "\<(doc|ins|exe)into\>" "\<f(owners|perms)\>" "\<(exe|ins|dir)opts\>"
  23. ## Highlight common commands used in ebuilds
  24. color blue "\<make\>" "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|let|ln|mkdir|mv|rm|sed|set|tar|touch|unset)\>"
  25. ## Highlight comments (doesnt work that well)
  26. color yellow "#.*$"
  27. ## Highlight strings (doesnt work that well)
  28. color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
  29. ## Trailing space is bad!
  30. color ,green "[[:space:]]+$"
  31. ## Here is an example for Portage control files
  32. ##
  33. syntax "/etc/portage" "\.(keywords|mask|unmask|use)$"
  34. ## Base text:
  35. color green "^.+$"
  36. ## Use flags:
  37. color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
  38. color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
  39. ## Likely version numbers:
  40. color magenta "-[[:digit:]].*([[:space:]]|$)"
  41. ## Accepted arches:
  42. color white "[~-]?\<(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\>"
  43. color white "[[:space:]][~-]?\*"
  44. ## Categories:
  45. color cyan "^[[:space:]]*.*/"
  46. ## Masking regulators:
  47. color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
  48. ## Comments:
  49. color yellow "#.*$"