Skip to content

Instantly share code, notes, and snippets.

@xypha
Last active June 16, 2025 11:56
Show Gist options
  • Select an option

  • Save xypha/baf6167058b4c37066c8257530c0ffad to your computer and use it in GitHub Desktop.

Select an option

Save xypha/baf6167058b4c37066c8257530c0ffad to your computer and use it in GitHub Desktop.
AutoHotkey lexer - Syntax Highlighting - User Defined Language - Notepad++
<?xml version="1.0" encoding="UTF-8" ?>
<NotepadPlus>
<UserLang name="AutoHotkey" ext="ahk ahkl ahkh ia" udlVersion="2.1">
<!-- Original source unknown -->
<!-- 2024.11.01 - additional changes from https://raw.githubusercontent.com/TorrentIvy/ahkv2-project-scripts/main/Notepad%2B%2B%20AutoHotKey%20Syntax%20Highlight.xml -->
<!-- 2024.11.01 - additional changes from https://raw.githubusercontent.com/jNizM/ahk_notepad-plus-plus/master/userDefineLang/default/userDefineLang_AHK.xml -->
<!-- 2024.11.01 - colours of "NUMBERS" and "FOLDER IN CODE1" - default: 000000 -->
<!-- 2024.11.27 - uploaded to https://gist.github.com/xypha/baf6167058b4c37066c8257530c0ffad -->
<!-- 2024.11.28 - add "as" to Keywords7 -->
<!-- 2025.06.15 - remove duplicates from latter keywords group, add some missing words from https://raw.githubusercontent.com/zufuliu/notepad4/main/tools/lang/AutoHotkey_L.ahk -->
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="yes" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="yes" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00; 01 02 03/* 04*/</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<Keywords name="Numbers, extras1"></Keywords>
<Keywords name="Numbers, extras2"></Keywords>
<Keywords name="Numbers, suffix1"></Keywords>
<Keywords name="Numbers, suffix2"></Keywords>
<Keywords name="Numbers, range"></Keywords>
<Keywords name="Operators1">- ! % &amp; ( ) , . : ? ^ | ~ + &lt; = &gt; * / [ ]</Keywords>
<Keywords name="Operators2"></Keywords>
<Keywords name="Folders in code1, open">{</Keywords>
<Keywords name="Folders in code1, middle"></Keywords>
<Keywords name="Folders in code1, close">}</Keywords>
<Keywords name="Folders in code2, open"></Keywords>
<Keywords name="Folders in code2, middle"></Keywords>
<Keywords name="Folders in code2, close"></Keywords>
<Keywords name="Folders in comment, open"></Keywords>
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">break byref case catch class const continue else exit exitapp finally for global gosub goto if ifequal ifexist ifgreater ifgreaterorequal ifinstring ifless iflessorequal ifmsgbox ifnotequal ifnotexist ifnotinstring ifwinactive ifwinexist ifwinnotactive ifwinnotexist local loop onexit pause return settimer sleep static suspend switch throw try until var while</Keywords>
<Keywords name="Keywords2">autotrim blockinput clipwait control controladditem controlchooseindex controlchoosestring controlclick controldeleteitem controlfocus controlget controlgetfocus controlgetpos controlgettext controlhide controlhidedropdown controlmove controlsend controlsendraw controlsendtext controlsetchecked controlsetenabled controlsetexstyle controlsetstyle controlsettext controlshow controlshowdropdown coordmode critical detecthiddentext detecthiddenwindows dircopy dircreate dirdelete dirmove download drive driveeject driveget drivelock driveretract drivesetlabel drivespacefree driveunlock editpaste envadd envdiv envget envmult envset envsub envupdate fileappend filecopy filecopydir filecreatedir filecreateshortcut filedelete fileencoding filegetattrib filegetshortcut filegetsize filegettime filegetversion fileinstall filemove filemovedir fileread filereadline filerecycle filerecycleempty fileremovedir fileselectfile fileselectfolder filesetattrib filesettime formattime getkeystate groupactivate groupadd groupclose groupdeactivate gui guicontrol guicontrolget hotif hotifwinactive hotifwinexist hotifwinnotactive hotifwinnotexist hotkey imagesearch inidelete iniread iniwrite input inputbox keyhistory keywait listhotkeys listlines listvars menu menuselect mouseclick mouseclickdrag mousegetpos mousemove msgbox outputdebug pixelgetcolor pixelsearch postmessage process processclose processsetpriority progress random randomseed regcreatekey regdelete regdeletekey regread regwrite run runas runwait send sendevent sendinput sendlevel sendmessage sendmode sendplay sendraw sendtext setbatchlines setcapslockstate setcontroldelay setdefaultmousespeed setenv setformat setkeydelay setmousedelay setnumlockstate setregview setscrolllockstate setstorecapslockmode settitlematchmode setwindelay setworkingdir shutdown sort soundbeep soundget soundgetwavevolume soundplay soundset soundsetmute soundsetvolume soundsetwavevolume splashimage splashtextoff splashtexton splitpath statusbargettext statusbarwait stringcasesense stringgetpos stringleft stringlen stringlower stringmid stringreplace stringright stringsplit stringtrimleft stringtrimright stringupper sysget thread tooltip transform traytip urldownloadtofile winactivate winactivatebottom winclose winget wingetactivestats wingetactivetitle wingetclass wingetclientpos wingetpos wingettext wingettitle winhide winkill winmaximize winmenuselectitem winminimize winminimizeall winminimizeallundo winmove winmovebottom winmovetop winredraw winrestore winset winsetalwaysontop winsetenabled winsetexstyle winsetregion winsetstyle winsettitle winsettranscolor winsettransparent winshow winwait winwaitactive winwaitclose winwaitnotactive FileObj</Keywords>
<Keywords name="Keywords3">unset shell32 _addref _clone _getaddress _getcapacity _haskey _insert _maxindex _minindex _newenum _release _remove _setcapacity abs acos array asc asin atan bind buffer bufferalloc call callbackcreate callbackfree caretgetpos ceil chr clear comcall comobjactive comobjarray comobjconnect comobjcreate comobject comobjenwrap comobjerror comobjflags comobjfromptr comobjget comobjmissing comobjparameter comobjquery comobjtype comobjunwrap comobjvalue controlfinditem controlgetchecked controlgetchoice controlgetclassnn controlgetenabled controlgetexstyle controlgethwnd controlgetindex controlgetitems controlgetstyle controlgetvisible cos dateadd datediff defineprop deleteprop direxist dirselect dllcall drivegetcapacity drivegetfilesystem drivegetlabel drivegetlist drivegetserial drivegetspacefree drivegetstatus drivegetstatuscd drivegettype editgetcurrentcol editgetcurrentline editgetline editgetlinecount editgetselectedtext exception exp fileexist fileopen fileselect floor format func get getkeyname getkeysc getkeyvk getmethod getownpropdesc guictrlfromhwnd guifromhwnd has hasbase hasmethod hasownprop hasprop hotstring il_add il_create il_destroy inputhook insertat instr isalnum isalpha isbyref isdigit isfloat isfunc isinteger islabel islower isnumber isobject isoptional isset issetref isspace istime isupper isxdigit listviewgetcontent ln loadpicture log ltrim lv_add lv_delete lv_deletecol lv_getcount lv_getnext lv_gettext lv_insert lv_insertcol lv_modify lv_modifycol lv_setimagelist map max menufromhandle menugethandle menugetname min mod monitorget monitorgetcount monitorgetname monitorgetprimary monitorgetworkarea numget numput objaddref objbindmethod objclone objcount objdelete object objfromptr objfromptraddref objgetaddress objgetbase objgetcapacity objhaskey objhasownprop objinsert objinsertat objlength objmaxindex objminindex objnewenum objownpropcount objownprops objpop objptr objptraddref objpush objrawget objrawset objrelease objremove objremoveat objsetbase objsetcapacity onclipboardchange onerror onmessage ord ownprops pop processexist processgetpath processgetname processwait processwaitclose push regexmatch regexreplace registercallback removeat round rtrim sb_seticon sb_setparts sb_settext set sin soundgetinterface soundgetmute soundgetname soundgetvolume sqrt strcompare strget strlen strlower strptr strput strreplace strsplit strtitle strupper substr sysgetipaddresses tan trayseticon trim tv_add tv_delete tv_get tv_getchild tv_getcount tv_getnext tv_getparent tv_getprev tv_getselection tv_gettext tv_modify tv_setimagelist varsetcapacity varsetstrcapacity vercompare winactive winexist wingetcontrols wingetcontrolshwnd wingetcount wingetexstyle wingetid wingetidlast wingetlist wingetminmax wingetpid wingetprocessname wingetprocesspath wingetstyle wingettranscolor wingettransparent Timeout AtEOF Encoding ClassNN ClickCount Focused FocusedCtrl Handle Size Name MaxParams MinParams MenuBar Mark Len IsVariadic IsBuiltIn ComValue String AddStandard Close GetClientPos GetPos OnCommand ProcessGetParent</Keywords>
<Keywords name="Keywords4"># $ 0x wm clipboardtimeout commentflag delimiter derefchar errorstdout escapechar hotkeyinterval hotkeymodifiertimeout iftimeout include includeagain inputlevel installkeybdhook installmousehook maxhotkeysperinterval maxmem maxthreads maxthreadsbuffer maxthreadsperhotkey menumaskkey mustdeclare noenv notrayicon persistent singleinstance usehook warn winactivateforce Requires Opt SetColor UseTab</Keywords>
<Keywords name="Keywords5">alt altdown altup appskey backspace blind browser_back browser_favorites browser_forward browser_home browser_refresh browser_search browser_stop bs capslock click control ctrl ctrlbreak ctrldown ctrlup del down end enter esc escape f1 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 f2 f20 f21 f22 f23 f24 f3 f4 f5 f6 f7 f8 f9 home ins insert joy1 joy10 joy11 joy12 joy13 joy14 joy15 joy16 joy17 joy18 joy19 joy2 joy20 joy21 joy22 joy23 joy24 joy25 joy26 joy27 joy28 joy29 joy3 joy30 joy31 joy32 joy4 joy5 joy6 joy7 joy8 joy9 joyaxes joybuttons joyinfo joyname joypov joyr joyu joyv joyx joyy joyz lalt launch_app1 launch_app2 launch_mail launch_media lbutton lcontrol lctrl left lshift lwin lwindown lwinup mbutton media_next media_play_pause media_prev media_stop numlock numpad0 numpad1 numpad2 numpad3 numpad4 numpad5 numpad6 numpad7 numpad8 numpad9 numpadadd numpadclear numpaddel numpaddiv numpaddot numpaddown numpadend numpadenter numpadhome numpadins numpadleft numpadmult numpadpgdn numpadpgup numpadright numpadsub numpadup pgdn pgup printscreen ralt raw rbutton rcontrol rctrl right rshift rwin rwindown rwinup scrolllock shift shiftdown shiftup space tab up volume_down volume_mute volume_up wheeldown wheelleft wheelright wheelup xbutton1 xbutton2</Keywords>
<Keywords name="Keywords6">a_ __ programfiles a_ahkpath super any a_ahkversion a_appdata a_appdatacommon a_args a_autotrim a_batchlines a_caretx a_carety a_computername a_comspec a_controldelay a_coordmodecaret a_coordmodemenu a_coordmodemouse a_coordmodepixel a_coordmodetooltip a_cursor a_dd a_ddd a_dddd a_defaultgui a_defaultlistview a_defaultmousespeed a_defaulttreeview a_desktop a_desktopcommon a_detecthiddentext a_detecthiddenwindows a_endchar a_eventinfo a_exitreason a_fileencoding a_formatfloat a_formatinteger a_gui a_guicontrol a_guicontrolevent a_guievent a_guiheight a_guiwidth a_guix a_guiy a_hour a_iconfile a_iconhidden a_iconnumber a_icontip a_index a_initialworkingdir a_ipaddress1 a_ipaddress2 a_ipaddress3 a_ipaddress4 a_is64bitos a_isadmin a_iscompiled a_iscritical a_ispaused a_issuspended a_isunicode a_keydelay a_keydelayplay a_keyduration a_keydurationplay a_language a_lasterror a_linefile a_linenumber a_listlines a_loopfield a_loopfileattrib a_loopfiledir a_loopfileext a_loopfilefullpath a_loopfilelongpath a_loopfilename a_loopfilepath a_loopfileshortname a_loopfileshortpath a_loopfilesize a_loopfilesizekb a_loopfilesizemb a_loopfiletimeaccessed a_loopfiletimecreated a_loopfiletimemodified a_loopreadline a_loopregkey a_loopregname a_loopregsubkey a_loopregtimemodified a_loopregtype a_mday a_min a_mm a_mmm a_mmmm a_mon a_mousedelay a_mousedelayplay a_msec a_msgboxresult a_mydocuments a_now a_nowutc a_numbatchlines a_ostype a_osversion a_priorhotkey a_priorkey a_programfiles a_programs a_programscommon a_ptrsize a_regview a_screendpi a_screenheight a_screenwidth a_scriptdir a_scriptfullpath a_scripthwnd a_scriptname a_sec a_sendlevel a_sendmode a_space a_startmenu a_startmenucommon a_startup a_startupcommon a_storecapslockmode a_stringcasesense a_tab a_temp a_thisfunc a_thishotkey a_thislabel a_thismenu a_thismenuitem a_thismenuitempos a_tickcount a_timeidle a_timeidlekeyboard a_timeidlemouse a_timeidlephysical a_timesincepriorhotkey a_timesincethishotkey a_titlematchmode a_titlematchmodespeed a_username a_wday a_windelay a_windir a_workingdir a_yday a_year a_yweek a_yyyy clipboard clipboardall comspec errorlevel this true false A_AllowMainWindow a_TrayMenu</Keywords>
<Keywords name="Keywords7">value casesense length enum minindex ptr onnotify reset title wparam lparam setfont stop marginx marginy seticon settext backcolor onevent extends clone __call __delete __get __handle __new __set abort abovenormal activex add addactivex addbutton addcheckbox addcombobox addcustom adddatetime adddropdownlist addedit addgroupbox addhotkey addlistbox addlistview addmonthcal addpicture addprogress addradio addslider addstatusbar addtab addtab2 addtab3 addtext addtreeview addupdown ahk_class ahk_exe ahk_group ahk_id ahk_pid all alnum alpha altsubmit alttab alttabandmenu alttabmenu alttabmenudismiss alwaysontop and autosize background backgroundtrans base belownormal between bitand bitnot bitor bitshiftleft bitshiftright bitxor bold border bottom button buttons cancel capacity caption center check check3 checkbox checked checkedgray choose choosestring color combobox contains controllist controllisthwnd count custom date datetime days ddl default delete deleteall deref destroy digit disable disabled dpiscale dropdownlist edit eject enable enabled error expand exstyle filesystem first flash float floatfast focus font force fromcodepage getaddress getcapacity grid group groupbox guiclose guicontextmenu guidropfiles guiescape guisize haskey hdr hidden hide high hkcc hkcr hkcu hkey_classes_root hkey_current_config hkey_current_user hkey_local_machine hkey_users hklm hku hours hscroll hwnd icon iconsmall id idlast ignore imagelist in integer integerfast interrupt is italic join label lastfound lastfoundexist limit lines link list listbox listview localsameasglobal lock logoff low lower lowercase mainwindow margin maximize maximizebox maxindex minimize minimizebox minmax minutes monitorcount monitorname monitorprimary monitorworkarea monthcal mouse mousemoveoff move multi na new no noactivate nodefault nohide noicon nomainwindow norm normal nosort nosorthdr nostandard not notab notimers number off ok on or as owndialogs owner parse password pic picture pid pixel pos pow priority processname processpath radio range rawread rawwrite read readchar readdouble readfloat readint readint64 readline readnum readonly readshort readuchar readuint readushort realtime redraw regex region reg_binary reg_dword reg_dword_big_endian reg_expand_sz reg_full_resource_descriptor reg_link reg_multi_sz reg_qword reg_resource_list reg_resource_requirements_list reg_sz relative reload remove rename report resize restore retry rgb screen seconds section seek sendandmouse serial setcapacity setlabel shiftalttab show single slider sortdesc standard status statusbar statuscd strike style submit sysmenu tab2 tabstop tell text theme tile time tip tocodepage togglecheck toggleenable toolwindow top topmost transcolor transparent tray treeview type uncheck underline unicode unlock updown upper uppercase useenv useerrorlevel useunsetglobal useunsetlocal vis visfirst visible vscroll waitclose wantctrla wantf2 wantreturn wanttab wrap write writechar writedouble writefloat writeint writeint64 writeline writenum writeshort writeuchar writeuint writeushort xdigit xm xp xs yes ym yp ys Files reg IndexError MemberError MemoryError MethodError OSError PropertyError TargetError TimeoutError TypeError UnsetError UnsetItemError ValueError ZeroDivisionError</Keywords>
<Keywords name="Keywords8">explore a b c d e f g h i j k l m n o p q r s t u v w x y z</Keywords>
<Keywords name="Delimiters">00&quot; 01 02&quot; 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" fgColor="FFFFFF" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" fgColor="8C868F" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="LINE COMMENTS" fgColor="8C868F" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="NUMBERS" fgColor="8c552a" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS1" fgColor="FF7800" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS2" fgColor="3B5BB5" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS3" fgColor="3B5BB5" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS4" fgColor="49a4cb" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS5" fgColor="22AA55" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS6" fgColor="B43C7A" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS7" fgColor="B43C7A" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS8" fgColor="98a346" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="OPERATORS" fgColor="8080C0" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" fgColor="8d877e" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" fgColor="409B1C" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS2" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment