|
| 1 | +" Vim syntax file |
| 2 | +" Language: Arduino |
| 3 | +" Maintainer: Sudar <sudar@sudarmuthu.com> |
| 4 | +" Original Author: Johannes Hoff <johannes@johanneshoff.com> |
| 5 | +" Last Change: 19 February 2013 |
| 6 | +" License: VIM license (:help license, replace vim by arduino.vim) |
| 7 | + |
| 8 | +" Syntax highlighting like in the Arduino IDE |
| 9 | +" Automatically generated by the script available at |
| 10 | +" https://bitbucket.org/johannes/arduino-vim-syntax |
| 11 | +" Using keywords from <arduino>/lib/keywords.txt |
| 12 | +" From version: |
| 13 | + |
| 14 | +" Thanks to original author Johannes Hoff and Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback! |
| 15 | + |
| 16 | +" For version 5.x: Clear all syntax items |
| 17 | +" For version 6.x: Quit when a syntax file was already loaded |
| 18 | +if version < 600 |
| 19 | + syntax clear |
| 20 | +elseif exists("b:current_syntax") |
| 21 | + finish |
| 22 | +endif |
| 23 | + |
| 24 | +" Read the C syntax to start with |
| 25 | +if version < 600 |
| 26 | + so <sfile>:p:h/cpp.vim |
| 27 | +else |
| 28 | + runtime! syntax/cpp.vim |
| 29 | +endif |
| 30 | + |
| 31 | +syn keyword arduinoConstant BIN CHANGE DEC DEFAULT EXTERNAL FALLING HALF_PI HEX |
| 32 | +syn keyword arduinoConstant HIGH INPUT INPUT_PULLUP INTERNAL INTERNAL1V1 |
| 33 | +syn keyword arduinoConstant INTERNAL2V56 LOW LSBFIRST MSBFIRST OCT OUTPUT PI |
| 34 | +syn keyword arduinoConstant RISING TWO_PI |
| 35 | + |
| 36 | +syn keyword arduinoFunc analogRead analogReference analogWrite |
| 37 | +syn keyword arduinoFunc attachInterrupt bit bitClear bitRead bitSet |
| 38 | +syn keyword arduinoFunc bitWrite delay delayMicroseconds detachInterrupt |
| 39 | +syn keyword arduinoFunc digitalRead digitalWrite highByte interrupts |
| 40 | +syn keyword arduinoFunc lowByte micros millis noInterrupts noTone pinMode |
| 41 | +syn keyword arduinoFunc pulseIn shiftIn shiftOut tone |
| 42 | + |
| 43 | +syn keyword arduinoMethod available begin end find findUntil flush loop |
| 44 | +syn keyword arduinoMethod parseFloat parseInt peek print println read |
| 45 | +syn keyword arduinoMethod readBytes readBytesUntil setTimeout setup |
| 46 | + |
| 47 | +syn keyword arduinoModule Serial Serial1 Serial2 Serial3 |
| 48 | + |
| 49 | +syn keyword arduinoStdFunc abs acos asin atan atan2 ceil constrain cos degrees |
| 50 | +syn keyword arduinoStdFunc exp floor log map max min radians random randomSeed |
| 51 | +syn keyword arduinoStdFunc round sin sq sqrt tan |
| 52 | + |
| 53 | +syn keyword arduinoType boolean byte null String word |
| 54 | + |
| 55 | +hi def link arduinoType Type |
| 56 | +hi def link arduinoConstant Constant |
| 57 | +hi def link arduinoStdFunc Function |
| 58 | +hi def link arduinoFunc Function |
| 59 | +hi def link arduinoMethod Function |
| 60 | +hi def link arduinoModule Identifier |
0 commit comments