1187
|
1 " Vim syntax file
|
|
2 " Language: AutoHotkey script file
|
10734
|
3 " Maintainer: Michael Wong
|
|
4 " https://github.com/mmikeww/autohotkey.vim
|
11347
|
5 " Latest Revision: 2017-04-03
|
10734
|
6 " Previous Maintainers: SungHyun Nam <goweol@gmail.com>
|
|
7 " Nikolai Weibull <now@bitwi.se>
|
1187
|
8
|
|
9 if exists("b:current_syntax")
|
|
10 finish
|
|
11 endif
|
|
12
|
|
13 let s:cpo_save = &cpo
|
|
14 set cpo&vim
|
|
15
|
|
16 syn case ignore
|
|
17
|
|
18 syn keyword autohotkeyTodo
|
|
19 \ contained
|
|
20 \ TODO FIXME XXX NOTE
|
|
21
|
10734
|
22 " only these chars are valid as escape sequences: ,%`;nrbtvaf
|
|
23 " https://autohotkey.com/docs/commands/_EscapeChar.htm
|
1187
|
24 syn match autohotkeyEscape
|
|
25 \ display
|
10734
|
26 \ '`[,%`;nrbtvaf]'
|
1187
|
27
|
|
28 syn region autohotkeyString
|
|
29 \ display
|
|
30 \ oneline
|
|
31 \ matchgroup=autohotkeyStringDelimiter
|
|
32 \ start=+"+
|
|
33 \ end=+"+
|
|
34 \ contains=autohotkeyEscape
|
|
35
|
10734
|
36 syn match autohotkeyVariable
|
1187
|
37 \ display
|
|
38 \ oneline
|
|
39 \ contains=autohotkeyBuiltinVariable
|
|
40 \ keepend
|
10734
|
41 \ '%\S\{-}%'
|
1187
|
42
|
|
43 syn keyword autohotkeyBuiltinVariable
|
|
44 \ A_Space A_Tab
|
10734
|
45 \ A_WorkingDir A_ScriptDir A_ScriptName A_ScriptFullPath A_ScriptHwnd A_LineNumber
|
|
46 \ A_LineFile A_ThisFunc A_ThisLabel A_AhkVersion A_AhkPath A_IsUnicode A_IsCompiled A_ExitReason
|
|
47 \ A_YYYY A_MM A_DD A_MMMM A_MMM A_DDDD A_DDD A_WDay A_YDay A_YWeek A_Hour A_Min
|
|
48 \ A_Mon A_Year A_MDay A_NumBatchLines
|
1187
|
49 \ A_Sec A_MSec A_Now A_NowUTC A_TickCount
|
10734
|
50 \ A_IsSuspended A_IsPaused A_IsCritical A_BatchLines A_TitleMatchMode A_TitleMatchModeSpeed
|
|
51 \ A_DetectHiddenWindows A_DetectHiddenText A_AutoTrim A_StringCaseSense
|
|
52 \ A_FileEncoding A_FormatInteger A_FormatFloat A_KeyDelay A_WinDelay A_ControlDelay
|
|
53 \ A_SendMode A_SendLevel A_StoreCapsLockMode A_KeyDelay A_KeyDelayDuration
|
|
54 \ A_KeyDelayPlay A_KeyDelayPlayDuration A_MouseDelayPlay
|
|
55 \ A_MouseDelay A_DefaultMouseSpeed A_RegView A_IconHidden A_IconTip A_IconFile
|
|
56 \ A_CoordModeToolTip A_CoordModePixel A_CoordModeMouse A_CoordModeCaret A_CoordModeMenu
|
1187
|
57 \ A_IconNumber
|
10734
|
58 \ A_TimeIdle A_TimeIdlePhysical A_DefaultGui A_DefaultListView A_DefaultTreeView
|
1187
|
59 \ A_Gui A_GuiControl A_GuiWidth A_GuiHeight A_GuiX A_GuiY A_GuiEvent
|
|
60 \ A_GuiControlEvent A_EventInfo
|
|
61 \ A_ThisMenuItem A_ThisMenu A_ThisMenuItemPos A_ThisHotkey A_PriorHotkey
|
10734
|
62 \ A_PriorKey A_TimeSinceThisHotkey A_TimeSincePriorHotkey A_EndChar
|
1187
|
63 \ ComSpec A_Temp A_OSType A_OSVersion A_Language A_ComputerName A_UserName
|
10734
|
64 \ A_Is64BitOS A_PtrSize
|
1187
|
65 \ A_WinDir A_ProgramFiles ProgramFiles A_AppData A_AppDataCommon A_Desktop
|
|
66 \ A_DesktopCommon A_StartMenu A_StartMenuCommon A_Programs
|
|
67 \ A_ProgramsCommon A_Startup A_StartupCommon A_MyDocuments A_IsAdmin
|
10734
|
68 \ A_ScreenWidth A_ScreenHeight A_ScreenDPI A_IPAddress1 A_IPAddress2 A_IPAddress3
|
1187
|
69 \ A_IPAddress4
|
|
70 \ A_Cursor A_CaretX A_CaretY Clipboard ClipboardAll ErrorLevel A_LastError
|
|
71 \ A_Index A_LoopFileName A_LoopRegName A_LoopReadLine A_LoopField
|
10734
|
72 \ A_LoopFileExt A_LoopFileFullPath A_LoopFileLongPath A_LoopFileShortPath
|
|
73 \ A_LoopFileShortName A_LoopFileDir A_LoopFileTimeModified A_LoopFileTimeCreated
|
|
74 \ A_LoopFileTimeAccessed A_LoopFileAttrib A_LoopFileSize A_LoopFileSizeKB A_LoopFileSizeMB
|
|
75 \ A_LoopRegType A_LoopRegKey A_LoopRegSubKey A_LoopRegTimeModified
|
1187
|
76
|
|
77 syn match autohotkeyBuiltinVariable
|
|
78 \ contained
|
|
79 \ display
|
|
80 \ '%\d\+%'
|
|
81
|
|
82 syn keyword autohotkeyCommand
|
|
83 \ ClipWait EnvGet EnvSet EnvUpdate
|
|
84 \ Drive DriveGet DriveSpaceFree FileAppend FileCopy FileCopyDir
|
10734
|
85 \ FileCreateDir FileCreateShortcut FileDelete FileGetAttrib FileEncoding
|
1187
|
86 \ FileGetShortcut FileGetSize FileGetTime FileGetVersion FileInstall
|
|
87 \ FileMove FileMoveDir FileReadLine FileRead FileRecycle FileRecycleEmpty
|
|
88 \ FileRemoveDir FileSelectFolder FileSelectFile FileSetAttrib FileSetTime
|
|
89 \ IniDelete IniRead IniWrite SetWorkingDir
|
|
90 \ SplitPath
|
|
91 \ Gui GuiControl GuiControlGet IfMsgBox InputBox MsgBox Progress
|
|
92 \ SplashImage SplashTextOn SplashTextOff ToolTip TrayTip
|
|
93 \ Hotkey ListHotkeys BlockInput ControlSend ControlSendRaw GetKeyState
|
|
94 \ KeyHistory KeyWait Input Send SendRaw SendInput SendPlay SendEvent
|
|
95 \ SendMode SetKeyDelay SetNumScrollCapsLockState SetStoreCapslockMode
|
|
96 \ EnvAdd EnvDiv EnvMult EnvSub Random SetFormat Transform
|
|
97 \ AutoTrim BlockInput CoordMode Critical Edit ImageSearch
|
|
98 \ ListLines ListVars Menu OutputDebug PixelGetColor PixelSearch
|
|
99 \ SetBatchLines SetEnv SetTimer SysGet Thread Transform URLDownloadToFile
|
|
100 \ Click ControlClick MouseClick MouseClickDrag MouseGetPos MouseMove
|
|
101 \ SetDefaultMouseSpeed SetMouseDelay
|
|
102 \ Process Run RunWait RunAs Shutdown Sleep
|
|
103 \ RegDelete RegRead RegWrite
|
|
104 \ SoundBeep SoundGet SoundGetWaveVolume SoundPlay SoundSet
|
|
105 \ SoundSetWaveVolume
|
|
106 \ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
|
|
107 \ StringLeft StringRight StringLower StringUpper StringMid StringReplace
|
10734
|
108 \ StringSplit StringTrimLeft StringTrimRight StringLen
|
11347
|
109 \ StrSplit StrReplace Throw
|
1187
|
110 \ Control ControlClick ControlFocus ControlGet ControlGetFocus
|
|
111 \ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
|
|
112 \ ControlSetText Menu PostMessage SendMessage SetControlDelay
|
|
113 \ WinMenuSelectItem GroupActivate GroupAdd GroupClose GroupDeactivate
|
|
114 \ DetectHiddenText DetectHiddenWindows SetTitleMatchMode SetWinDelay
|
|
115 \ StatusBarGetText StatusBarWait WinActivate WinActivateBottom WinClose
|
|
116 \ WinGet WinGetActiveStats WinGetActiveTitle WinGetClass WinGetPos
|
|
117 \ WinGetText WinGetTitle WinHide WinKill WinMaximize WinMinimize
|
|
118 \ WinMinimizeAll WinMinimizeAllUndo WinMove WinRestore WinSet
|
|
119 \ WinSetTitle WinShow WinWait WinWaitActive WinWaitNotActive WinWaitClose
|
10734
|
120 \ SetCapsLockState SetNumLockState SetScrollLockState
|
1187
|
121
|
|
122 syn keyword autohotkeyFunction
|
11347
|
123 \ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr Func
|
1187
|
124 \ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
|
|
125 \ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan
|
10734
|
126 \ FileExist GetKeyState NumGet NumPut StrGet StrPut RegisterCallback
|
|
127 \ IsFunc Trim LTrim RTrim IsObject Object Array FileOpen
|
|
128 \ ComObjActive ComObjArray ComObjConnect ComObjCreate ComObjGet
|
|
129 \ ComObjError ComObjFlags ComObjQuery ComObjType ComObjValue ComObject
|
11347
|
130 \ Format Exception
|
1187
|
131
|
|
132 syn keyword autohotkeyStatement
|
|
133 \ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
|
11347
|
134 \ Suspend Reload new class extends
|
1187
|
135
|
|
136 syn keyword autohotkeyRepeat
|
|
137 \ Loop
|
|
138
|
|
139 syn keyword autohotkeyConditional
|
|
140 \ IfExist IfNotExist If IfEqual IfLess IfGreater Else
|
10734
|
141 \ IfWinExist IfWinNotExist IfWinActive IfWinNotActive
|
|
142 \ IfNotEqual IfLessOrEqual IfGreaterOrEqual
|
11347
|
143 \ while until for in try catch finally
|
1187
|
144
|
|
145 syn match autohotkeyPreProcStart
|
|
146 \ nextgroup=
|
|
147 \ autohotkeyInclude,
|
|
148 \ autohotkeyPreProc
|
|
149 \ skipwhite
|
|
150 \ display
|
|
151 \ '^\s*\zs#'
|
|
152
|
|
153 syn keyword autohotkeyInclude
|
|
154 \ contained
|
|
155 \ Include
|
|
156 \ IncludeAgain
|
|
157
|
|
158 syn keyword autohotkeyPreProc
|
|
159 \ contained
|
|
160 \ HotkeyInterval HotKeyModifierTimeout
|
|
161 \ Hotstring
|
|
162 \ IfWinActive IfWinNotActive IfWinExist IfWinNotExist
|
10734
|
163 \ If IfTimeout
|
1187
|
164 \ MaxHotkeysPerInterval MaxThreads MaxThreadsBuffer MaxThreadsPerHotkey
|
|
165 \ UseHook InstallKeybdHook InstallMouseHook
|
|
166 \ KeyHistory
|
|
167 \ NoTrayIcon SingleInstance
|
|
168 \ WinActivateForce
|
|
169 \ AllowSameLineComments
|
|
170 \ ClipboardTimeout
|
|
171 \ CommentFlag
|
|
172 \ ErrorStdOut
|
|
173 \ EscapeChar
|
|
174 \ MaxMem
|
|
175 \ NoEnv
|
|
176 \ Persistent
|
10734
|
177 \ LTrim
|
|
178 \ InputLevel
|
|
179 \ MenuMaskKey
|
|
180 \ Warn
|
1187
|
181
|
|
182 syn keyword autohotkeyMatchClass
|
11347
|
183 \ ahk_group ahk_class ahk_id ahk_pid ahk_exe
|
1187
|
184
|
|
185 syn match autohotkeyNumbers
|
|
186 \ display
|
|
187 \ transparent
|
|
188 \ contains=
|
|
189 \ autohotkeyInteger,
|
|
190 \ autohotkeyFloat
|
|
191 \ '\<\d\|\.\d'
|
|
192
|
|
193 syn match autohotkeyInteger
|
|
194 \ contained
|
|
195 \ display
|
|
196 \ '\d\+\>'
|
|
197
|
|
198 syn match autohotkeyInteger
|
|
199 \ contained
|
|
200 \ display
|
|
201 \ '0x\x\+\>'
|
|
202
|
|
203 syn match autohotkeyFloat
|
|
204 \ contained
|
|
205 \ display
|
|
206 \ '\d\+\.\d*\|\.\d\+\>'
|
|
207
|
|
208 syn keyword autohotkeyType
|
|
209 \ local
|
|
210 \ global
|
10734
|
211 \ static
|
|
212 \ byref
|
1187
|
213
|
1618
|
214 syn keyword autohotkeyBoolean
|
|
215 \ true
|
|
216 \ false
|
|
217
|
10734
|
218 syn match autohotkeyHotkey
|
|
219 \ contains=autohotkeyKey,
|
|
220 \ autohotkeyHotkeyDelimiter
|
|
221 \ display
|
11347
|
222 \ '^\s*\S*\%( Up\)\?::'
|
10734
|
223
|
|
224 syn match autohotkeyKey
|
|
225 \ contained
|
|
226 \ display
|
|
227 \ '^.\{-}'
|
|
228
|
|
229 syn match autohotkeyDelimiter
|
|
230 \ contained
|
|
231 \ display
|
|
232 \ '::'
|
|
233
|
|
234 " allowable hotstring options:
|
|
235 " https://autohotkey.com/docs/Hotstrings.htm
|
|
236 syn match autohotkeyHotstringDefinition
|
|
237 \ contains=autohotkeyHotstring,
|
|
238 \ autohotkeyHotstringDelimiter
|
|
239 \ display
|
|
240 \ '^\s*:\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*:.\{-}::'
|
|
241
|
|
242 syn match autohotkeyHotstring
|
|
243 \ contained
|
|
244 \ display
|
|
245 \ '.\{-}'
|
|
246
|
|
247 syn match autohotkeyHotstringDelimiter
|
|
248 \ contained
|
|
249 \ display
|
|
250 \ '::'
|
|
251
|
|
252 syn match autohotkeyHotstringDelimiter
|
|
253 \ contains=autohotkeyHotstringOptions
|
|
254 \ contained
|
|
255 \ display
|
|
256 \ ':\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*:'
|
|
257
|
|
258 syn match autohotkeyHotstringOptions
|
|
259 \ contained
|
|
260 \ display
|
|
261 \ '\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*'
|
|
262
|
|
263 syn cluster autohotkeyCommentGroup
|
|
264 \ contains=
|
|
265 \ autohotkeyTodo,
|
|
266 \ @Spell
|
|
267
|
|
268 syn match autohotkeyComment
|
|
269 \ display
|
|
270 \ contains=@autohotkeyCommentGroup
|
|
271 \ '\%(^;\|\s\+;\).*$'
|
|
272
|
|
273 syn region autohotkeyComment
|
|
274 \ contains=@autohotkeyCommentGroup
|
|
275 \ matchgroup=autohotkeyCommentStart
|
|
276 \ start='^\s*/\*'
|
|
277 \ end='^\s*\*/'
|
|
278
|
1698
|
279 " TODO: Shouldn't we look for g:, b:, variables before defaulting to
|
|
280 " something?
|
|
281 if exists("g:autohotkey_syntax_sync_minlines")
|
|
282 let b:autohotkey_syntax_sync_minlines = g:autohotkey_syntax_sync_minlines
|
|
283 else
|
|
284 let b:autohotkey_syntax_sync_minlines = 50
|
|
285 endif
|
|
286 exec "syn sync ccomment autohotkeyComment minlines=" . b:autohotkey_syntax_sync_minlines
|
|
287
|
1187
|
288 hi def link autohotkeyTodo Todo
|
|
289 hi def link autohotkeyComment Comment
|
|
290 hi def link autohotkeyCommentStart autohotkeyComment
|
|
291 hi def link autohotkeyEscape Special
|
|
292 hi def link autohotkeyHotkey Type
|
|
293 hi def link autohotkeyKey Type
|
|
294 hi def link autohotkeyDelimiter Delimiter
|
|
295 hi def link autohotkeyHotstringDefinition Type
|
|
296 hi def link autohotkeyHotstring Type
|
|
297 hi def link autohotkeyHotstringDelimiter autohotkeyDelimiter
|
|
298 hi def link autohotkeyHotstringOptions Special
|
|
299 hi def link autohotkeyString String
|
|
300 hi def link autohotkeyStringDelimiter autohotkeyString
|
|
301 hi def link autohotkeyVariable Identifier
|
|
302 hi def link autohotkeyVariableDelimiter autohotkeyVariable
|
|
303 hi def link autohotkeyBuiltinVariable Macro
|
|
304 hi def link autohotkeyCommand Keyword
|
|
305 hi def link autohotkeyFunction Function
|
|
306 hi def link autohotkeyStatement autohotkeyCommand
|
|
307 hi def link autohotkeyRepeat Repeat
|
|
308 hi def link autohotkeyConditional Conditional
|
|
309 hi def link autohotkeyPreProcStart PreProc
|
|
310 hi def link autohotkeyInclude Include
|
|
311 hi def link autohotkeyPreProc PreProc
|
|
312 hi def link autohotkeyMatchClass Typedef
|
|
313 hi def link autohotkeyNumber Number
|
|
314 hi def link autohotkeyInteger autohotkeyNumber
|
|
315 hi def link autohotkeyFloat autohotkeyNumber
|
|
316 hi def link autohotkeyType Type
|
1618
|
317 hi def link autohotkeyBoolean Boolean
|
1187
|
318
|
|
319 let b:current_syntax = "autohotkey"
|
|
320
|
|
321 let &cpo = s:cpo_save
|
|
322 unlet s:cpo_save
|