arduino.nanorc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ## FILENAME: arduino.nanorc
  2. ##
  3. ## DESCRIPTION: The arduino.nanorc syntax files allows syntax highlighting
  4. ## for Arduino sketch files in the GNU nano text editor.
  5. ##
  6. ## Maintainer: Nicholas Wilde
  7. ## Version: 0.1
  8. ## DATE: 06/23/2011
  9. ##
  10. ## HOMEPAGE: http://code.google.com/p/arduino-nano-editor-syntax/
  11. ##
  12. ## COMMENTS: -Most of the code was taken from the c.nanorc code found with
  13. ## GNU nano 2.2.6.
  14. ## -Direction was taken from the arduino vim syntax code by johannes
  15. ## <https://bitbucket.org/johannes/arduino-vim-syntax/>
  16. ## -Tested on Ubuntu Server 11.04 Natty Narwhal and GNU nano 2.2.6
  17. ##
  18. ## DIRECTIONS: For Ubuntu Server 11.04 Natty Narwhal:
  19. ## -Move this file <arduino.nanorc> to the nano directory
  20. ## /usr/share/nano/
  21. ## -Add arduino.nanorc reference to the nanorc settings file
  22. ## /etc/nanorc
  23. ## ...
  24. ## ## Arduino
  25. ## /usr/share/nano/arduino.nanorc
  26. ## ...
  27. syntax "ino" "\.?ino$"
  28. ##
  29. color brightred "\<[A-Z_][0-9A-Z_]+\>"
  30. ##
  31. color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
  32. ## Constants
  33. icolor green "\<(HIGH|LOW|INPUT|OUTPUT)\>"
  34. ## Serial Print
  35. icolor red "\<(DEC|BIN|HEX|OCT|BYTE)\>"
  36. ## PI Constants
  37. icolor green "\<(PI|HALF_PI|TWO_PI)\>"
  38. ## ShiftOut
  39. icolor green "\<(LSBFIRST|MSBFIRST)\>"
  40. ## Attach Interrupt
  41. icolor green "\<(CHANGE|FALLING|RISING)\>"
  42. ## Analog Reference
  43. icolor green "\<(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\>"
  44. ## === FUNCTIONS === ##
  45. ## Data Types
  46. color green "\<(boolean|byte|char|float|int|long|word)\>"
  47. ## Control Structions
  48. color brightyellow "\<(case|class|default|do|double|else|false|for|if|new|null|private|protected|public|short|signed|static|String|switch|this|throw|try|true|unsigned|void|while)\>"
  49. color magenta "\<(goto|continue|break|return)\>"
  50. ## Math
  51. color brightyellow "\<(abs|acos|asin|atan|atan2|ceil|constrain|cos|degrees|exp|floor|log|map|max|min|radians|random|randomSeed|round|sin|sq|sqrt|tan)\>"
  52. ## Bits & Bytes
  53. color brightyellow "\<(bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte)\>"
  54. ## Analog I/O
  55. color brightyellow "\<(analogReference|analogRead|analogWrite)\>"
  56. ## External Interrupts
  57. color brightyellow "\<(attachInterrupt|detachInterrupt)\>"
  58. ## Time
  59. color brightyellow "\<(delay|delayMicroseconds|millis|micros)\>"
  60. ## Digital I/O
  61. color brightyellow "\<(pinMode|digitalWrite|digitalRead)\>"
  62. ## Interrupts
  63. color brightyellow "\<(interrupts|noInterrupts)\>"
  64. ## Advanced I/O
  65. color brightyellow "\<(noTone|pulseIn|shiftIn|shiftOut|tone)\>"
  66. ## Serial
  67. color magenta "\<(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\>"
  68. ## Structure
  69. color brightyellow "\<(setup|loop)\>"
  70. ##
  71. color brightcyan "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
  72. ##
  73. color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
  74. ## GCC builtins
  75. color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
  76. ## String highlighting. You will in general want your comments and
  77. ## strings to come last, because syntax highlighting rules will be
  78. ## applied in the order they are read in.
  79. color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
  80. ## This string is VERY resource intensive!
  81. color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
  82. ## Comments
  83. color brightblue "//.*"
  84. color brightblue start="/\*" end="\*/"
  85. ## Trailing whitespace
  86. color ,green "[[:space:]]+$"