├── README └── syntax └── arduino.vim /README: -------------------------------------------------------------------------------- 1 | This is a mirror of http://www.vim.org/scripts/script.php?script_id=2654 2 | 3 | This syntax file provides syntax highlighting like the Arduino IDE. That is, Arduino specific names like digitalWrite is highlighted in addition to C++ syntax. 4 | 5 | The syntax file is automatically generated by my script at http://bitbucket.org/johannes/arduino-vim-syntax 6 | 7 | Licensed under the vim license: http://groups.google.com/group/vim_use/browse_thread/thread/bdb036cd8acda1ba/75b353c598a0cd6f?lnk=gst&q=license#75b353c598a0cd6f 8 | -------------------------------------------------------------------------------- /syntax/arduino.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Arduino 3 | " Maintainer: Johannes Hoff 4 | " Last Change: 17 May 2015 5 | " License: VIM license (:help license, replace vim by arduino.vim) 6 | 7 | " Syntax highlighting like in the Arduino IDE 8 | " Automatically generated by the script available at 9 | " https://bitbucket.org/johannes/arduino-vim-syntax 10 | " Using keywords from /build/shared/lib/keywords.txt 11 | " From version: ARDUINO 1.6.4 - 2015.05.06 12 | 13 | " Thanks to Rik, Erik Nomitch, Adam Obeng, Graeme Cross and Niall Parker 14 | " 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 :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 yield 42 | 43 | syn keyword arduinoMethod available availableForWrite begin charAt compareTo 44 | syn keyword arduinoMethod concat end endsWith equals equalsIgnoreCase find 45 | syn keyword arduinoMethod findUntil flush getBytes indexOf lastIndexOf length 46 | syn keyword arduinoMethod loop parseFloat parseInt peek print println read 47 | syn keyword arduinoMethod readBytes readBytesUntil readString readStringUntil 48 | syn keyword arduinoMethod replace setCharAt setTimeout setup startsWith 49 | syn keyword arduinoMethod substring toCharArray toInt toLowerCase toUpperCase 50 | syn keyword arduinoMethod trim word 51 | 52 | syn keyword arduinoModule Keyboard Mouse Serial Serial1 Serial2 Serial3 53 | syn keyword arduinoModule SerialUSB 54 | 55 | syn keyword arduinoStdFunc abs accept acos asin atan atan2 ceil click constrain 56 | syn keyword arduinoStdFunc cos degrees exp floor isPressed log map max min 57 | syn keyword arduinoStdFunc move pow press radians random randomSeed release 58 | syn keyword arduinoStdFunc releaseAll round sin sq sqrt tan 59 | 60 | syn keyword arduinoType boolean byte null String word 61 | 62 | hi def link arduinoType Type 63 | hi def link arduinoConstant Constant 64 | hi def link arduinoStdFunc Function 65 | hi def link arduinoFunc Function 66 | hi def link arduinoMethod Function 67 | hi def link arduinoModule Identifier 68 | --------------------------------------------------------------------------------