xref: /vim-8.2.3635/runtime/syntax/arduino.vim (revision 113cb513)
1" Vim syntax file
2" Language:    Arduino
3" Maintainer:  Johannes Hoff <[email protected]>
4" Last Change: 21 October 2021
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://github.com/johshoff/arduino-vim-syntax
10" Using keywords from <arduino>/build/shared/lib/keywords.txt
11" From version: 1.8.16
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
18if version < 600
19  syntax clear
20elseif exists("b:current_syntax")
21  finish
22endif
23
24" Read the C syntax to start with
25if version < 600
26  so <sfile>:p:h/cpp.vim
27else
28  runtime! syntax/cpp.vim
29endif
30
31syn 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
36
37syn 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
45
46syn 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
55
56syn keyword arduinoModule    Keyboard Mouse Serial Serial1 Serial2 Serial3
57syn keyword arduinoModule    SerialUSB
58
59syn 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
70
71syn 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
77
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
84