blob: 1c9618ff0fd019a7aca2c3371e2a92369c6976ff [file] [log] [blame]
Bram Moolenaar438f67a2014-01-07 06:09:28 +01001" Vim syntax file
2" Language: Arduino
3" Maintainer: Johannes Hoff <johannes@johanneshoff.com>
Bram Moolenaar079ba762021-10-23 12:08:41 +01004" Last Change: 21 October 2021
Bram Moolenaar438f67a2014-01-07 06:09:28 +01005" License: VIM license (:help license, replace vim by arduino.vim)
6
7" Syntax highlighting like in the Arduino IDE
Bram Moolenaar079ba762021-10-23 12:08:41 +01008" Automatically generated by the script available at
9" https://bitbucket.org/johannes/arduino-vim-syntax
10" Using keywords from <arduino>/build/shared/lib/keywords.txt
11" From version: 1.8.16
Bram Moolenaar438f67a2014-01-07 06:09:28 +010012
Bram Moolenaar079ba762021-10-23 12:08:41 +010013" Thanks to Rik, Erik Nomitch, Adam Obeng, Graeme Cross and Niall Parker
14" for helpful feedback!
Bram Moolenaar438f67a2014-01-07 06:09:28 +010015
Bram Moolenaar079ba762021-10-23 12:08:41 +010016" For version 5.x: Clear all syntax items
17" For version 6.x: Quit when a syntax file was already loaded
18if version < 600
19 syntax clear
20elseif exists("b:current_syntax")
Bram Moolenaar438f67a2014-01-07 06:09:28 +010021 finish
22endif
23
24" Read the C syntax to start with
Bram Moolenaar079ba762021-10-23 12:08:41 +010025if version < 600
26 so <sfile>:p:h/cpp.vim
27else
28 runtime! syntax/cpp.vim
29endif
Bram Moolenaar438f67a2014-01-07 06:09:28 +010030
Bram Moolenaar079ba762021-10-23 12:08:41 +010031syn keyword arduinoConstant BIN CHANGE DEC DEFAULT EXTERNAL FALLING HALF_PI HEX
32syn keyword arduinoConstant HIGH INPUT INPUT_PULLUP INTERNAL INTERNAL1V1
33syn keyword arduinoConstant INTERNAL2V56 LED_BUILTIN LED_BUILTIN_RX
34syn keyword arduinoConstant LED_BUILTIN_TX LOW LSBFIRST MSBFIRST OCT OUTPUT PI
35syn keyword arduinoConstant RISING TWO_PI
Bram Moolenaar438f67a2014-01-07 06:09:28 +010036
Bram Moolenaar079ba762021-10-23 12:08:41 +010037syn keyword arduinoFunc analogRead analogReadResolution analogReference
38syn keyword arduinoFunc analogWrite analogWriteResolution attachInterrupt
39syn keyword arduinoFunc bit bitClear bitRead bitSet bitWrite delay
40syn keyword arduinoFunc delayMicroseconds detachInterrupt
41syn keyword arduinoFunc digitalPinToInterrupt digitalRead digitalWrite
42syn keyword arduinoFunc highByte interrupts lowByte micros millis
43syn keyword arduinoFunc noInterrupts noTone pinMode pulseIn pulseInLong
44syn keyword arduinoFunc shiftIn shiftOut tone yield
Bram Moolenaar438f67a2014-01-07 06:09:28 +010045
Bram Moolenaar079ba762021-10-23 12:08:41 +010046syn keyword arduinoMethod available availableForWrite begin charAt compareTo
47syn keyword arduinoMethod concat end endsWith equals equalsIgnoreCase export
48syn keyword arduinoMethod final find findUntil flush getBytes indexOf
49syn keyword arduinoMethod lastIndexOf length loop override parseFloat
50syn keyword arduinoMethod parseInt peek print println read readBytes
51syn keyword arduinoMethod readBytesUntil readString readStringUntil replace
52syn keyword arduinoMethod setCharAt setTimeout setup startsWith Stream
53syn keyword arduinoMethod substring toCharArray toInt toLowerCase toUpperCase
54syn keyword arduinoMethod trim
Bram Moolenaar438f67a2014-01-07 06:09:28 +010055
Bram Moolenaar079ba762021-10-23 12:08:41 +010056syn keyword arduinoModule Keyboard Mouse Serial Serial1 Serial2 Serial3
57syn keyword arduinoModule SerialUSB
Bram Moolenaar438f67a2014-01-07 06:09:28 +010058
Bram Moolenaar079ba762021-10-23 12:08:41 +010059syn keyword arduinoStdFunc abs accept acos acosf asin asinf atan atan2 atan2f
60syn keyword arduinoStdFunc atanf cbrt cbrtf ceil ceilf click constrain
61syn keyword arduinoStdFunc copysign copysignf cos cosf cosh coshf degrees exp
62syn keyword arduinoStdFunc expf fabs fabsf fdim fdimf floor floorf fma fmaf
63syn keyword arduinoStdFunc fmax fmaxf fmin fminf fmod fmodf hypot hypotf
64syn keyword arduinoStdFunc isfinite isinf isnan isPressed ldexp ldexpf log
65syn keyword arduinoStdFunc log10 log10f logf lrint lrintf lround lroundf map
66syn keyword arduinoStdFunc max min move pow powf press radians random
67syn keyword arduinoStdFunc randomSeed release releaseAll round roundf signbit
68syn keyword arduinoStdFunc sin sinf sinh sinhf sq sqrt sqrtf tan tanf tanh
69syn keyword arduinoStdFunc tanhf trunc truncf
Bram Moolenaar438f67a2014-01-07 06:09:28 +010070
Bram Moolenaar079ba762021-10-23 12:08:41 +010071syn keyword arduinoType _Bool _Complex _Imaginary array atomic_bool
72syn keyword arduinoType atomic_char atomic_int atomic_llong atomic_long
73syn keyword arduinoType atomic_schar atomic_short atomic_uchar atomic_uint
74syn keyword arduinoType atomic_ullong atomic_ulong atomic_ushort boolean
75syn keyword arduinoType byte char16_t char32_t complex NULL null PROGMEM
76syn keyword arduinoType String word
Bram Moolenaar438f67a2014-01-07 06:09:28 +010077
78hi def link arduinoType Type
79hi def link arduinoConstant Constant
80hi def link arduinoStdFunc Function
81hi def link arduinoFunc Function
82hi def link arduinoMethod Function
83hi def link arduinoModule Identifier