1" Vim syntax file 2" Language: Arduino 3" Maintainer: Johannes Hoff <[email protected]> 4" Last Change: 2011 June 3 5" License: VIM license (:help license, replace vim by arduino.vim) 6 7" Syntax highlighting like in the Arduino IDE 8" Keywords extracted from <arduino>/build/shared/lib/keywords.txt (arduino 9" version 0021) 10 11" Thanks to Rik, Erik Nomitch, Adam Obeng and Graeme Cross for helpful feedback! 12 13" quit when a syntax file was already loaded 14if exists("b:current_syntax") 15 finish 16endif 17 18" Read the C syntax to start with 19runtime! syntax/cpp.vim 20 21syn keyword arduinoConstant HIGH LOW INPUT OUTPUT 22syn keyword arduinoConstant DEC BIN HEX OCT BYTE 23syn keyword arduinoConstant PI HALF_PI TWO_PI 24syn keyword arduinoConstant LSBFIRST MSBFIRST 25syn keyword arduinoConstant CHANGE FALLING RISING 26syn keyword arduinoConstant SERIAL DISPLAY 27syn keyword arduinoConstant DEFAULT EXTERNAL INTERNAL INTERNAL1V1 INTERNAL2V56 28 29syn keyword arduinoStdFunc abs acos asin atan atan2 ceil constrain 30syn keyword arduinoStdFunc cos degrees exp floor log 31syn keyword arduinoStdFunc map max min pow radians 32syn keyword arduinoStdFunc round sin sq sqrt tan 33syn keyword arduinoStdFunc randomSeed random 34 35syn keyword arduinoFunc analogReference analogRead analogWrite 36syn keyword arduinoFunc attachInterrupt detachInterrupt interrupts noInterrupts 37syn keyword arduinoFunc lowByte highByte bitRead bitWrite bitSet bitClear 38syn keyword arduinoFunc millis micros delay delayMicroseconds 39syn keyword arduinoFunc pinMode digitalWrite digitalRead 40syn keyword arduinoFunc tone noTone pulseIn shiftOut 41 42syn keyword arduinoMethod setup loop 43syn keyword arduinoMethod begin end available read flush print println write peek 44 45syn keyword arduinoType boolean byte word String 46 47syn keyword arduinoModule Serial Serial1 Serial2 Serial3 48 49hi def link arduinoType Type 50hi def link arduinoConstant Constant 51hi def link arduinoStdFunc Function 52hi def link arduinoFunc Function 53hi def link arduinoMethod Function 54hi def link arduinoModule Identifier 55