├── editors ├── greenpad │ ├── readme.md │ └── GreenPad.ahk └── EditPlus2 │ └── Edit2.ahk ├── syntax-files └── TotalHLT │ ├── readme.md │ └── ahk.lang ├── .gitattributes ├── Directives.txt ├── .gitignore ├── functions └── GetAHKSyntaxFiles.ahk ├── Functions.txt ├── Keys.txt ├── Variables.txt ├── Commands.txt ├── readme.md └── Keywords.txt /editors/greenpad/readme.md: -------------------------------------------------------------------------------- 1 | Installer for AutoHotkey Syntax Highlighting 2 | GreenPad version 1.08 U 3 | http://www.kmonos.net/lib/gp.en.html -------------------------------------------------------------------------------- /syntax-files/TotalHLT/readme.md: -------------------------------------------------------------------------------- 1 | TotalHLT (Total Highlight) is a Lister plugin for [Total Commander](http://www.ghisler.com/). 2 | 3 | The major function is to display source code files with syntax highlight. 4 | Available on totalcmd.net at http://www.totalcmd.net/plugring/hlight.html 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /Directives.txt: -------------------------------------------------------------------------------- 1 | #AllowSameLineComments 2 | #ClipboardTimeout 3 | #CommentFlag 4 | #ErrorStdOut 5 | #EscapeChar 6 | #HotkeyInterval 7 | #HotkeyModifierTimeout 8 | #Hotstring 9 | #If 10 | #IfTimeout 11 | #IfWinActive 12 | #IfWinExist 13 | #IfWinNotActive 14 | #IfWinNotExist 15 | #Include 16 | #IncludeAgain 17 | #InputLevel 18 | #InstallKeybdHook 19 | #InstallMouseHook 20 | #KeyHistory 21 | #LTrim 22 | #MaxHotkeysPerInterval 23 | #MaxMem 24 | #MaxThreads 25 | #MaxThreadsBuffer 26 | #MaxThreadsPerHotkey 27 | #MenuMaskKey 28 | #NoEnv 29 | #NoTrayIcon 30 | #Persistent 31 | #SingleInstance 32 | #UseHook 33 | #Warn 34 | #WinActivateForce -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /functions/GetAHKSyntaxFiles.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Part of the AutoHotkey Editors project: 4 | https://github.com/ahkscript/AutoHotkey-Editors/ 5 | 6 | This function downloads several text files from GH and it 7 | removes empty lines and comments so that there is one keyword 8 | per line. 9 | 10 | Each "type" has its own file: 11 | Commands, Directives, Functions, Keywords, Variables, Keys 12 | 13 | */ 14 | GetAHKSyntaxFiles() { 15 | FileDelete, tmpfile$$$.htm 16 | FileList:="Commands,Directives,Functions,Keywords,Variables,Keys" 17 | Loop, parse, FileList, CSV 18 | { 19 | URLDownloadToFile, https://raw.github.com/ahkscript/AutoHotkey-Editors/master/%A_LoopField%.txt, tmpfile$$$.txt 20 | FileRead, File, tmpfile$$$.txt 21 | File:=RegExReplace(RegExReplace(File, "`nm)^;.+\R" ), "`nm)^\n" ) ; remove empty lines and comments 22 | FileDelete, %A_LoopField%.txt 23 | FileAppend, %File%, %A_LoopField%.txt 24 | FileDelete, tmpfile$$$.txt 25 | File:="" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Functions.txt: -------------------------------------------------------------------------------- 1 | Abs 2 | ACos 3 | Asc 4 | ASin 5 | ATan 6 | Ceil 7 | Chr 8 | Cos 9 | DllCall 10 | Exp 11 | FileExist 12 | Floor 13 | Format 14 | Func 15 | IsByRef 16 | IsFunc 17 | IsLabel 18 | Ln 19 | Log 20 | FileExist 21 | FileOpen 22 | GetKeyState 23 | GetKeyName 24 | GetKeyVK 25 | GetKeySC 26 | InStr 27 | IL_Add 28 | IL_Create 29 | IL_Destroy 30 | LV_Add 31 | LV_Delete 32 | LV_DeleteCol 33 | LV_GetCount 34 | LV_GetNext 35 | LV_GetText 36 | LV_Insert 37 | LV_InsertCol 38 | LV_Modify 39 | LV_ModifyCol 40 | LV_SetImageList 41 | Trim 42 | LTrim 43 | RTrim 44 | Mod 45 | NumGet 46 | NumPut 47 | OnMessage 48 | Ord 49 | RegExMatch 50 | RegExReplace 51 | RegisterCallback 52 | Round 53 | SB_SetIcon 54 | SB_SetParts 55 | SB_SetText 56 | Sin 57 | Sqrt 58 | StrGet 59 | StrLen 60 | StrPut 61 | StrReplace 62 | StrSplit 63 | SubStr 64 | Tan 65 | TV_Add 66 | TV_Delete 67 | TV_GetChild 68 | TV_GetCount 69 | TV_GetNext 70 | TV_Get 71 | TV_GetParent 72 | TV_GetPrev 73 | TV_GetSelection 74 | TV_GetText 75 | TV_Modify 76 | TV_SetImageList 77 | VarSetCapacity 78 | WinActive 79 | WinExist 80 | 81 | ; objects/classes 82 | Object 83 | Array 84 | IsObject 85 | ObjInsert 86 | _Insert 87 | ObjRemove 88 | _Remove 89 | ObjMinIndex 90 | _MinIndex 91 | ObjMaxIndex 92 | _MaxIndex 93 | ObjSetCapacity 94 | _SetCapacity 95 | ObjGetCapacity 96 | _GetCapacity 97 | ObjGetAddress 98 | _GetAddress 99 | ObjNewEnum 100 | _NewEnum 101 | ObjAddRef 102 | _AddRef 103 | ObjRelease 104 | _Release 105 | ObjHasKey 106 | _HasKey 107 | ObjClone 108 | _Clone 109 | __Get 110 | __Set 111 | __Call 112 | __Delete 113 | __New 114 | ComObjCreate 115 | ComObjGet 116 | ComObjConnect 117 | ComObjError 118 | ComObjActive 119 | ComObjEnwrap 120 | ComObjUnwrap 121 | ComObjParameter 122 | ComObjType 123 | ComObjValue 124 | ComObjMissing 125 | ComObjArray 126 | ComObjQuery 127 | ComObjFlags 128 | -------------------------------------------------------------------------------- /Keys.txt: -------------------------------------------------------------------------------- 1 | ^ 2 | + 3 | ! 4 | # 5 | ~ 6 | $ 7 | ` 8 | Shift 9 | LShift 10 | RShift 11 | Alt 12 | LAlt 13 | RAlt 14 | Control 15 | LControl 16 | RControl 17 | Ctrl 18 | LCtrl 19 | RCtrl 20 | LWin 21 | RWin 22 | AppsKey 23 | 24 | AltDown 25 | AltUp 26 | ShiftDown 27 | ShiftUp 28 | CtrlDown 29 | CtrlUp 30 | LWinDown 31 | LWinUp 32 | RWinDown 33 | RWinUp 34 | 35 | LButton 36 | RButton 37 | MButton 38 | WheelUp 39 | WheelDown 40 | XButton1 41 | XButton2 42 | 43 | Joy1 44 | Joy2 45 | Joy3 46 | Joy4 47 | Joy5 48 | Joy6 49 | Joy7 50 | Joy8 51 | Joy9 52 | Joy10 53 | Joy11 54 | Joy12 55 | Joy13 56 | Joy14 57 | Joy15 58 | Joy16 59 | Joy17 60 | Joy18 61 | Joy19 62 | Joy20 63 | Joy21 64 | Joy22 65 | Joy23 66 | Joy24 67 | Joy25 68 | Joy26 69 | Joy27 70 | Joy28 71 | Joy29 72 | Joy30 73 | Joy31 74 | Joy32 75 | JoyX 76 | JoyY 77 | JoyZ 78 | JoyR 79 | JoyU 80 | JoyV 81 | JoyPOV 82 | JoyName 83 | JoyButtons 84 | JoyAxes 85 | JoyInfo 86 | 87 | Space 88 | Tab 89 | Enter 90 | ; Not this one since it's already a keyword (a command): RETURN 91 | Escape 92 | Esc 93 | BackSpace 94 | BS 95 | Delete 96 | Del 97 | Insert 98 | Ins 99 | PGUP 100 | PGDN 101 | Home 102 | End 103 | Up 104 | Down 105 | Left 106 | Right 107 | 108 | PrintScreen 109 | CtrlBreak 110 | Pause 111 | ScrollLock 112 | CapsLock 113 | NumLock 114 | 115 | Numpad0 116 | Numpad1 117 | Numpad2 118 | Numpad3 119 | Numpad4 120 | Numpad5 121 | Numpad6 122 | Numpad7 123 | Numpad8 124 | Numpad9 125 | NumpadMult 126 | NumpadAdd 127 | NumpadSub 128 | NumpadDiv 129 | NumpadDot 130 | NumpadDel 131 | NumpadIns 132 | NumpadClear 133 | NumpadUp 134 | NumpadDown 135 | NumpadLeft 136 | NumpadRight 137 | NumpadHome 138 | NumpadEnd 139 | NumpadPgup 140 | NumpadPgdn 141 | NumpadEnter 142 | 143 | F1 144 | F2 145 | F3 146 | F4 147 | F5 148 | F6 149 | F7 150 | F8 151 | F9 152 | F10 153 | F11 154 | F12 155 | F13 156 | F14 157 | F15 158 | F16 159 | F17 160 | F18 161 | F19 162 | F20 163 | F21 164 | F22 165 | F23 166 | F24 167 | 168 | Browser_Back 169 | Browser_Forward 170 | Browser_Refresh 171 | Browser_Stop 172 | Browser_Search 173 | Browser_Favorites 174 | Browser_Home 175 | Volume_Mute 176 | Volume_Down 177 | Volume_Up 178 | Media_Next 179 | Media_Prev 180 | Media_Stop 181 | Media_Play_Pause 182 | Launch_Mail 183 | Launch_Media 184 | Launch_App1 185 | Launch_App2 186 | -------------------------------------------------------------------------------- /Variables.txt: -------------------------------------------------------------------------------- 1 | A_AhkPath 2 | A_AhkVersion 3 | A_AppData 4 | A_AppDataCommon 5 | A_AutoTrim 6 | A_BatchLines 7 | A_CaretX 8 | A_CaretY 9 | A_ComputerName 10 | A_ControlDelay 11 | A_Cursor 12 | A_DD 13 | A_DDD 14 | A_DDDD 15 | A_DefaultMouseSpeed 16 | A_Desktop 17 | A_DesktopCommon 18 | A_DetectHiddenText 19 | A_DetectHiddenWindows 20 | A_EndChar 21 | A_EventInfo 22 | A_ExitReason 23 | A_FileEncoding 24 | A_FormatFloat 25 | A_FormatInteger 26 | A_Gui 27 | A_GuiEvent 28 | A_GuiControl 29 | A_GuiControlEvent 30 | A_GuiHeight 31 | A_GuiWidth 32 | A_GuiX 33 | A_GuiY 34 | A_Hour 35 | A_IconFile 36 | A_IconHidden 37 | A_IconNumber 38 | A_IconTip 39 | A_Index 40 | A_IPAddress1 41 | A_IPAddress2 42 | A_IPAddress3 43 | A_IPAddress4 44 | A_Is64bitOS 45 | A_IsAdmin 46 | A_IsCompiled 47 | A_IsCritical 48 | A_IsPaused 49 | A_IsSuspended 50 | A_IsUnicode 51 | A_KeyDelay 52 | A_Language 53 | A_LastError 54 | A_LineFile 55 | A_LineNumber 56 | A_LoopField 57 | A_LoopFileAttrib 58 | A_LoopFileDir 59 | A_LoopFileExt 60 | A_LoopFileFullPath 61 | A_LoopFileLongPath 62 | A_LoopFileName 63 | A_LoopFileShortName 64 | A_LoopFileShortPath 65 | A_LoopFileSize 66 | A_LoopFileSizeKB 67 | A_LoopFileSizeMB 68 | A_LoopFileTimeAccessed 69 | A_LoopFileTimeCreated 70 | A_LoopFileTimeModified 71 | A_LoopReadLine 72 | A_LoopRegKey 73 | A_LoopRegName 74 | A_LoopRegSubkey 75 | A_LoopRegTimeModified 76 | A_LoopRegType 77 | A_MDAY 78 | A_Min 79 | A_MM 80 | A_MMM 81 | A_MMMM 82 | A_Mon 83 | A_MouseDelay 84 | A_MSec 85 | A_MyDocuments 86 | A_Now 87 | A_NowUTC 88 | A_NumBatchLines 89 | A_OSType 90 | A_OSVersion 91 | A_PriorHotkey 92 | A_PriorKey 93 | A_ProgramFiles 94 | A_Programs 95 | A_ProgramsCommon 96 | A_PtrSize 97 | A_RegView 98 | A_ScreenDPI 99 | A_ScreenHeight 100 | A_ScreenWidth 101 | A_ScriptDir 102 | A_ScriptFullPath 103 | A_ScriptHwnd 104 | A_ScriptName 105 | A_Sec 106 | A_Space 107 | A_StartMenu 108 | A_StartMenuCommon 109 | A_Startup 110 | A_StartupCommon 111 | A_StringCaseSense 112 | A_Tab 113 | A_Temp 114 | A_ThisFunc 115 | A_ThisHotkey 116 | A_ThisLabel 117 | A_ThisMenu 118 | A_ThisMenuItem 119 | A_ThisMenuItemPos 120 | A_TickCount 121 | A_TimeIdle 122 | A_TimeIdlePhysical 123 | A_TimeSincePriorHotkey 124 | A_TimeSinceThisHotkey 125 | A_TitleMatchMode 126 | A_TitleMatchModeSpeed 127 | A_UserName 128 | A_WDay 129 | A_WinDelay 130 | A_WinDir 131 | A_WorkingDir 132 | A_YDay 133 | A_YEAR 134 | A_YWeek 135 | A_YYYY 136 | Clipboard 137 | ClipboardAll 138 | ComSpec 139 | ErrorLevel 140 | ProgramFiles 141 | true 142 | false -------------------------------------------------------------------------------- /Commands.txt: -------------------------------------------------------------------------------- 1 | AutoTrim 2 | BlockInput 3 | Break 4 | Click 5 | ClipWait 6 | Catch 7 | Continue 8 | Control 9 | ControlClick 10 | ControlFocus 11 | ControlGet 12 | ControlGetFocus 13 | ControlGetPos 14 | ControlGetText 15 | ControlMove 16 | ControlSend 17 | ControlSendRaw 18 | ControlSetText 19 | CoordMode 20 | Critical 21 | DetectHiddenText 22 | DetectHiddenWindows 23 | Drive 24 | DriveGet 25 | DriveSpaceFree 26 | Edit 27 | Else 28 | EnvAdd 29 | EnvDiv 30 | EnvGet 31 | EnvMult 32 | EnvSet 33 | EnvSub 34 | EnvUpdate 35 | Exit 36 | ExitApp 37 | FileAppend 38 | FileCopy 39 | FileCopyDir 40 | FileCreateDir 41 | FileCreateShortcut 42 | FileDelete 43 | FileEncoding 44 | FileGetAttrib 45 | FileGetShortcut 46 | FileGetSize 47 | FileGetTime 48 | FileGetVersion 49 | FileInstall 50 | FileMove 51 | FileMoveDir 52 | FileRead 53 | FileReadLine 54 | FileRecycle 55 | FileRecycleEmpty 56 | FileRemoveDir 57 | FileSelectFile 58 | FileSelectFolder 59 | FileSetAttrib 60 | FileSetTime 61 | Finally 62 | For 63 | FormatTime 64 | GetKeyState 65 | Gosub 66 | Goto 67 | GroupActivate 68 | GroupAdd 69 | GroupClose 70 | GroupDeactivate 71 | Gui 72 | GuiControl 73 | GuiControlGet 74 | Hotkey 75 | If 76 | IfEqual 77 | IfExist 78 | IfGreater 79 | IfGreaterOrEqual 80 | IfInString 81 | IfLess 82 | IfLessOrEqual 83 | IfMsgBox 84 | IfNotEqual 85 | IfNotExist 86 | IfNotInString 87 | IfWinActive 88 | IfWinExist 89 | IfWinNotActive 90 | IfWinNotExist 91 | ImageSearch 92 | IniDelete 93 | IniRead 94 | IniWrite 95 | Input 96 | InputBox 97 | KeyHistory 98 | KeyWait 99 | ListHotkeys 100 | ListLines 101 | ListVars 102 | Loop 103 | Menu 104 | MouseClick 105 | MouseClickDrag 106 | MouseGetPos 107 | MouseMove 108 | MsgBox 109 | OnExit 110 | OutputDebug 111 | Pause 112 | PixelGetColor 113 | PixelSearch 114 | PostMessage 115 | Process 116 | Progress 117 | Random 118 | RegDelete 119 | RegRead 120 | RegWrite 121 | Reload 122 | Return 123 | Run 124 | RunAs 125 | RunWait 126 | Send 127 | SendEvent 128 | SendInput 129 | SendLevel 130 | SendMessage 131 | SendMode 132 | SendPlay 133 | SendRaw 134 | SetBatchLines 135 | SetCapslockState 136 | SetControlDelay 137 | SetDefaultMouseSpeed 138 | SetEnv 139 | SetFormat 140 | SetKeyDelay 141 | SetMouseDelay 142 | SetNumlockState 143 | SetRegView 144 | SetScrollLockState 145 | SetStoreCapslockMode 146 | SetTimer 147 | SetTitleMatchMode 148 | SetWinDelay 149 | SetWorkingDir 150 | Shutdown 151 | Sleep 152 | Sort 153 | SoundBeep 154 | SoundGet 155 | SoundGetWaveVolume 156 | SoundPlay 157 | SoundSet 158 | SoundSetWaveVolume 159 | SplashImage 160 | SplashTextOff 161 | SplashTextOn 162 | SplitPath 163 | StatusBarGetText 164 | StatusBarWait 165 | StringCaseSense 166 | StringGetPos 167 | StringLeft 168 | StringLen 169 | StringLower 170 | StringMid 171 | StringReplace 172 | StringRight 173 | StringSplit 174 | StringTrimLeft 175 | StringTrimRight 176 | StringUpper 177 | Suspend 178 | SysGet 179 | Thread 180 | Throw 181 | ToolTip 182 | Transform 183 | TrayTip 184 | Try 185 | Until 186 | URLDownloadToFile 187 | While 188 | WinActivate 189 | WinActivateBottom 190 | WinClose 191 | WinGet 192 | WinGetActiveStats 193 | WinGetActiveTitle 194 | WinGetClass 195 | WinGetPos 196 | WinGetText 197 | WinGetTitle 198 | WinHide 199 | WinKill 200 | WinMaximize 201 | WinMenuSelectItem 202 | WinMinimize 203 | WinMinimizeAll 204 | WinMinimizeAllUndo 205 | WinMove 206 | WinRestore 207 | WinSet 208 | WinSetTitle 209 | WinShow 210 | WinWait 211 | WinWaitActive 212 | WinWaitClose 213 | WinWaitNotActive -------------------------------------------------------------------------------- /editors/greenpad/GreenPad.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | AutoHotkey-Editors 3 | https://github.com/ahkscript/AutoHotkey-Editors/ 4 | 5 | Installer for AutoHotkey Syntax Highlighting - Version 1.0 6 | Requires AHK v1.1+ because of FileEncoding (has to be UTF-16) 7 | 8 | If you must: for basic users comment line 99: FileEncoding, UTF-16 ; this line requires ahk_l 9 | and Run this script, be sure to see the Imporant remark below or 10 | otherwise Greenpad will probably crash while opening *.ahk files. 11 | 12 | Tested with GreenPad version 1.08 U 13 | 14 | GreenPad can be found here: 15 | http://www.kmonos.net/lib/gp.en.html 16 | 17 | AutoHotkey forum thread: 18 | http://www.autohotkey.com/forum/topic68644.html 19 | 20 | Instructions: 21 | 22 | * Copy this script to your GreenPad directory, if you don't you 23 | will have to select the directory where you have installed 24 | GreenPad when the script is started. 25 | 26 | * It will modify GreenPad.ini and install ahk.kwd in your TYPE directory 27 | or you can update the keyword file. 28 | 29 | Imporant: 30 | 31 | * If GreenPad crashes when you open a AutoHotkey file, you will need to 32 | open type\ahk.kwd and choose "Save As": 33 | - Character Encoding: UFT-16LE 34 | - LineEnding: LF 35 | Now it should work. 36 | 37 | TODO: 38 | - Lines 1 - 4 for new file! 39 | 40 | */ 41 | 42 | SetWorkingDir, %A_ScriptDir% 43 | GreenPadDir:=A_ScriptDir 44 | Update=0 45 | 46 | MsgBox, , Exit GreenPad, Exit GreenPad before installing AutoHotkey Syntax Highlighting. 47 | 48 | IfNotExist, %A_ScriptDir%\GreenPad.exe 49 | { 50 | FileSelectFolder, GreenPadDir, , , Select the directory where GreenPad is installed 51 | If (ErrorLevel = 1) 52 | { 53 | MsgBox, 16, Canceled, Installation canceled. 54 | ExitApp 55 | } 56 | } 57 | 58 | Loop 59 | { 60 | IniRead, Key, %GreenPadDir%\GreenPad.ini, DocType, %A_Index% 61 | If (Key = "AHK") 62 | { 63 | IniRead, File, GreenPad.ini, AHK, Keyword, ahk.kwd 64 | MsgBox, 20, Warning, AutoHotkey Syntax Highlighting already installed.`nDo you wish to update the AutoHotkey Syntax File: %file% 65 | IfMsgBox, No 66 | ExitApp 67 | Update=1 ; we only have to update the keyword file 68 | Break 69 | } 70 | If (Key = "") or (Key = "ERROR") 71 | { 72 | Key:=A_Index 73 | Break 74 | } 75 | } 76 | 77 | If (Update = 0) 78 | { 79 | File=ahk.kwd 80 | IniWrite, AHK , %GreenPadDir%\GreenPad.ini, DocType, %Key% 81 | Key++ 82 | IniWrite, %A_Space% , %GreenPadDir%\GreenPad.ini, DocType, %Key% 83 | iniwrite, .*\.ahk$ , %GreenPadDir%\GreenPad.ini, AHK, Pattern 84 | IniWrite, ahk.kwd , %GreenPadDir%\GreenPad.ini, AHK, Keyword 85 | IniWrite, program.lay, %GreenPadDir%\GreenPad.ini, AHK, Layout 86 | } 87 | 88 | TrayTip, Downloading, AutoHotkey syntax files..., 5 89 | 90 | GetAHKSyntaxFiles() 91 | 92 | FileList=Commands,Directives,Functions,Keywords,Variables,Keys 93 | Loop, parse, FileList, CSV 94 | { 95 | FileRead, Read, %GreenPadDir%\%A_LoopField%.txt 96 | SyntaxFile .= read "`n" 97 | FileDelete, %GreenPadDir%\%A_LoopField%.txt 98 | Read= 99 | } 100 | StringReplace, SyntaxFile, SyntaxFile, #, ,All ; Greenpad can't use these 101 | StringReplace, SyntaxFile, SyntaxFile, `r`n,`r,All 102 | Sort, SyntaxFile, D`r 103 | SyntaxFile:="0111`n/*`n*/`n;`n" SyntaxFile 104 | 105 | FileDelete, %GreenPadDir%\type\%file% 106 | FileEncoding, UTF-16 ; this line requires ahk_l 107 | FileAppend, %SyntaxFile%, %GreenPadDir%\type\%file% 108 | 109 | MsgBox Done! 110 | 111 | /* 112 | 113 | Part of the AutoHotkey Editors project: 114 | https://github.com/ahkscript/AutoHotkey-Editors/ 115 | 116 | This function downloads several text files from GH and it 117 | removes empty lines and comments so that there is one keyword 118 | per line. 119 | 120 | Each "type" has its own file: 121 | Commands, Directives, Functions, Keywords, Variables, Keys 122 | 123 | */ 124 | GetAHKSyntaxFiles() { 125 | FileDelete, tmpfile$$$.htm 126 | FileList:="Commands,Directives,Functions,Keywords,Variables,Keys" 127 | Loop, parse, FileList, CSV 128 | { 129 | URLDownloadToFile, https://raw.github.com/ahkscript/AutoHotkey-Editors/master/%A_LoopField%.txt, tmpfile$$$.txt 130 | FileRead, File, tmpfile$$$.txt 131 | File:=RegExReplace(RegExReplace(File, "`nm)^;.+\R" ), "`nm)^\n" ) ; remove empty lines and comments 132 | FileDelete, %A_LoopField%.txt 133 | FileAppend, %File%, %A_LoopField%.txt 134 | FileDelete, tmpfile$$$.txt 135 | File:="" 136 | } 137 | } -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # AutoHotkey Syntax Highlighting for text editors 2 | 3 | A collection of links and scripts to setup [syntax highlighting](http://en.wikipedia.org/wiki/Syntax_highlighting) 4 | for a variety of text editors. 5 | 6 | This GitHub repository tries to maintain current versions of Keywords, Functions, Variables, Directives, Commands and Keys that used to be included with the AutoHotkey "basic" installer. By having installation scripts download these files from this repository, they are easier to maintain, and if written properly, make it easier to update your current syntax files when new commands or keywords are added to AutoHotkey. 7 | 8 | A simple function to download the files from GH can be found [here](functions/GetAHKSyntaxFiles.ahk), but you can of course write your own. 9 | 10 | ## Syntax files 11 | 12 | Available files (for AutoHotkey 1.x) 13 | 14 | * [Commands.txt](Commands.txt) 15 | * [Directives.txt](Directives.txt) 16 | * [Functions.txt](Functions.txt) 17 | * [Keywords.txt](Keywords.txt) 18 | * [Variables.txt](Variables.txt) 19 | * [Keys.txt](Keys.txt) 20 | 21 | Available files (for AutoHotkey 2.x) 22 | 23 | * None as of yet 24 | 25 | ## Supported Editors 26 | 27 | ### Dedicated AutoHotkey Editors: 28 | 29 | * [AHK Studio](http://ahkscript.org/boards/viewtopic.php?f=6&t=300) - [Forum](http://ahkscript.org/boards/viewtopic.php?f=6&t=300) - Scintilla based editor written in AHK for AHK 30 | * [SciTE4AutoHotkey](http://fincs.ahk4.net/scite4ahk/) - [forum](http://ahkscript.org/boards/viewtopic.php?f=6&t=62) 31 | * [QuickAHK](http://www.autohotkey.net/~jballi/QuickAHK/v2.2/QuickAHK.zip) - [forum](http://www.autohotkey.com/board/topic/33125-quickahk-v22/) 32 | 33 | ### Installation scripts: 34 | 35 | * [EditPlus 2](editors/EditPlus2/) 36 | * [Greenpad](editors/greenpad/) 37 | 38 | ### Ready made syntax higlighting (may not be uptodate): 39 | 40 | * [AkelPad](https://github.com/Lenchik/Akelpad-syntax-highlighting/blob/master/ahk.coder) - tested with v4.8.7 (x64) with Coder 12.4 plugin 41 | * [Atom.io](https://github.com/nshakin/language-autohotkey) - rudimentary 42 | * [HiEditor](http://www.winasm.net/forum/index.php?showtopic=2321) 43 | * [Notepad++](http://ahkscript.org/boards/viewtopic.php?f=7&t=50) - v6.5.1 44 | * [Sublime Text 2/3](https://github.com/ahkscript/SublimeAutoHotkey) 45 | * [TextPad](http://www.textpad.com/add-ons/files/syntax/autohotkey.zip) - *last update 2004* 46 | * [TotalHLT](syntax-files/TotalHLT/) - Language file for TotalHLT, a Lister plugin for Total Commander 47 | * [Vim](https://github.com/vim-scripts/autohotkey-ahk) 48 | 49 | **Gone missing or to do** 50 | 51 | * ConTEXT 52 | * Crimson Editor 53 | * EditPlus 54 | * Emacs 55 | * EmEditor 56 | * jEdit 57 | * MED 58 | * PSPad 59 | * TextPad 60 | * UltraEdit 61 | 62 | ### Editors with "built-in" AutoHotkey syntax highlighting: 63 | 64 | * [EverEdit](http://www.everedit.net) 65 | * [notepad2-mod](http://xhmikosr.github.io/notepad2-mod/) 66 | * [SynWrite](http://sourceforge.net/projects/synwrite/) 67 | 68 | ### Other 69 | 70 | * [CodeQuickTester](http://ahkscript.org/boards/viewtopic.php?f=6&t=6113) - The quick code tester/editor 71 | * [GeSHi](https://github.com/GeSHi/) - PHP based "Generic Syntax Highlighter" 72 | * [Highlight](http://www.andre-simon.de/doku/highlight/en/highlight.php) - converts sourcecode to HTML, XHTML, RTF, LaTeX, TeX, SVG, BBCode and terminal escape sequences with coloured syntax highlighting 73 | * [Script: Syntax highlighting for posting AutoHotkey code on phpbb forums](https://github.com/ahkon/Highlite) 74 | * [Web Syntax Highlighters](https://github.com/ahkscript/awesome-AutoHotkey#web-syntax-highlighters) 75 | * [Wordpress plugin](https://wordpress.org/plugins/syntaxhighlighter-evolved-autohotkey-brush/) 76 | 77 | ## Functions 78 | 79 | **Download files and strip comments and empty lines** 80 | 81 | Available functions (for AutoHotkey 1.x) 82 | 83 | * [GetAHKSyntaxFiles()](functions/GetAHKSyntaxFiles.ahk) 84 | 85 | ## Writing your own 86 | 87 | If you write or update a script please do take into account the following: 88 | 89 | * Include any specific instructions at the top of your installer script(s) 90 | * Try to detect if syntax highlighting is already installed, if so, offer the option to the user to only update the Syntax File (and not affect any colour schemes they may already have setup) 91 | * Always have your script download these files from the GitHub repository: [Commands.txt](Commands.txt), [Directives.txt](Directives.txt), [Functions.txt](Functions.txt), [Keywords.txt](Keywords.txt), [Variables.txt](Variables.txt) and [Keys.txt](Keys.txt). That way your script does not have to be updated when a new function or command is added. 92 | * Submit a pull request to this GH repository to have your script included here 93 | 94 | -------------------------------------------------------------------------------- /Keywords.txt: -------------------------------------------------------------------------------- 1 | ; Used with CoordMode or PixelXXX commands: 2 | Pixel 3 | Mouse 4 | Screen 5 | Relative 6 | RGB 7 | Caret 8 | Menu 9 | 10 | ; Continuation sections: 11 | LTrim 12 | RTrim 13 | Join 14 | 15 | ; Priority of processes 16 | Low 17 | BelowNormal 18 | Normal 19 | AboveNormal 20 | High 21 | Realtime 22 | 23 | ; Keywords inside the WinTitle parameter of various commands: 24 | ahk_class 25 | ahk_exe 26 | ahk_id 27 | ahk_group 28 | ahk_pid 29 | 30 | ; Used with SetFormat and/or "if Var is [not] type" & BETWEEN/IN 31 | Between 32 | Contains 33 | In 34 | Is 35 | Integer 36 | Float 37 | Number 38 | Digit 39 | Xdigit 40 | Alpha 41 | Upper 42 | Lower 43 | Alnum 44 | Time 45 | Date 46 | ; Omitted because it's a key name too: SPACE 47 | 48 | ; Expression keywords: 49 | not 50 | or 51 | and 52 | 53 | ; Used with Drive/DriveGet and/or WinGet/WinSet: 54 | AlwaysOnTop 55 | Topmost 56 | Top 57 | Bottom 58 | Transparent 59 | TransColor 60 | Redraw 61 | Region 62 | ID 63 | IDLast 64 | ProcessName 65 | MinMax 66 | ControlList 67 | Count 68 | List 69 | Capacity 70 | StatusCD 71 | Eject 72 | Lock 73 | Unlock 74 | Label 75 | FileSystem 76 | Label 77 | SetLabel 78 | Serial 79 | Type 80 | Status 81 | 82 | ; For functions: 83 | static 84 | global 85 | local 86 | ByRef 87 | 88 | ; Time units for use with addition and subtraction: 89 | Seconds 90 | Minutes 91 | Hours 92 | Days 93 | 94 | ; For use with the Loop command: 95 | Read 96 | Parse 97 | 98 | ; A_ExitReason 99 | Logoff 100 | Close 101 | Error 102 | Single 103 | 104 | ; The following are Commented out because they are already a keywords due to being a commands: 105 | ;Shutdown 106 | ;Menu 107 | ;Exit 108 | ;Reload 109 | 110 | ; Keywords used with the "menu" command: 111 | Tray 112 | Add 113 | Rename 114 | Check 115 | UnCheck 116 | ToggleCheck 117 | Enable 118 | Disable 119 | ToggleEnable 120 | Default 121 | NoDefault 122 | Standard 123 | NoStandard 124 | Color 125 | Delete 126 | DeleteAll 127 | Icon 128 | NoIcon 129 | Tip 130 | Click 131 | Show 132 | MainWindow 133 | NoMainWindow 134 | UseErrorLevel 135 | 136 | ; Gui control types (note that Edit, Progress and Hotkey aren't included since they are already command keywords): 137 | Text 138 | Picture 139 | Pic 140 | GroupBox 141 | Button 142 | Checkbox 143 | Radio 144 | DropDownList 145 | DDL 146 | ComboBox 147 | ListBox 148 | ListView 149 | DateTime 150 | MonthCal 151 | Slider 152 | StatusBar 153 | Tab 154 | Tab2 155 | TreeView 156 | UpDown 157 | ActiveX 158 | Link 159 | Custom 160 | 161 | ; ListView: 162 | IconSmall 163 | Tile 164 | Report 165 | SortDesc 166 | NoSort 167 | NoSortHdr 168 | Grid 169 | Hdr 170 | AutoSize 171 | Range 172 | 173 | ; General GUI keywords: 174 | xm 175 | ym 176 | ys 177 | xs 178 | xp 179 | yp 180 | 181 | Font 182 | Resize 183 | Owner 184 | Submit 185 | NoHide 186 | Minimize 187 | Maximize 188 | Restore 189 | NoActivate 190 | NA 191 | Cancel 192 | Destroy 193 | Center 194 | DPIScale 195 | 196 | Margin 197 | MaxSize 198 | MinSize 199 | OwnDialogs 200 | GuiEscape 201 | GuiClose 202 | GuiSize 203 | GuiContextMenu 204 | GuiDropFiles 205 | OnClipboardChange 206 | 207 | TabStop 208 | Section 209 | AltSubmit 210 | Wrap 211 | HScroll 212 | VScroll 213 | Border 214 | Top 215 | Bottom 216 | Buttons 217 | Expand 218 | First 219 | ImageList 220 | Lines 221 | WantCtrlA 222 | WantF2 223 | Vis 224 | VisFirst 225 | Number 226 | Uppercase 227 | Lowercase 228 | Limit 229 | Password 230 | Multi 231 | WantReturn 232 | Group 233 | Background 234 | bold 235 | italic 236 | strike 237 | underline 238 | norm 239 | BackgroundTrans 240 | Theme 241 | Caption 242 | Delimiter 243 | MinimizeBox 244 | MaximizeBox 245 | SysMenu 246 | ToolWindow 247 | Flash 248 | Style 249 | ExStyle 250 | Check3 251 | Checked 252 | CheckedGray 253 | ReadOnly 254 | Password 255 | Hidden 256 | Left 257 | Right 258 | Center 259 | NoTab 260 | Section 261 | Move 262 | Focus 263 | Hide 264 | Choose 265 | ChooseString 266 | Text 267 | Pos 268 | Enabled 269 | Disabled 270 | Visible 271 | LastFound 272 | LastFoundExist 273 | 274 | ; Already included with menu: 275 | ;Show 276 | ;Menu 277 | ;Color 278 | ;Edit 279 | ;Default 280 | ;Enable 281 | ;Disable 282 | ;Default 283 | 284 | ; Keywords used with the Hotkey command: 285 | AltTab 286 | ShiftAltTab 287 | AltTabMenu 288 | AltTabAndMenu 289 | AltTabMenuDismiss 290 | 291 | ; Keywords used with the Thread/Process commands 292 | NoTimers 293 | Interrupt 294 | Priority 295 | WaitClose 296 | Wait 297 | Exist 298 | Close 299 | 300 | ; Keywords for Send (these key names are also listed in Keys.txt, but without braces): 301 | {Blind} 302 | {Click} 303 | {Raw} 304 | {AltDown} 305 | {AltUp} 306 | {ShiftDown} 307 | {ShiftUp} 308 | {CtrlDown} 309 | {CtrlUp} 310 | {LWinDown} 311 | {LWinUp} 312 | {RWinDown} 313 | {RWinUp} 314 | 315 | ; Keywords used with the Transform command: 316 | Unicode 317 | Asc 318 | Chr 319 | Deref 320 | Mod 321 | Pow 322 | Exp 323 | Sqrt 324 | Log 325 | Ln 326 | Round 327 | Ceil 328 | Floor 329 | Abs 330 | Sin 331 | Cos 332 | Tan 333 | ASin 334 | ACos 335 | ATan 336 | BitNot 337 | BitAnd 338 | BitOr 339 | BitXOr 340 | BitShiftLeft 341 | BitShiftRight 342 | 343 | ToCodePage 344 | FromCodePage 345 | 346 | ; Keywords used with "IfMsgBox" ("continue" is not present here because it's a command too): 347 | Yes 348 | No 349 | Ok 350 | Cancel 351 | Abort 352 | Retry 353 | Ignore 354 | TryAgain 355 | 356 | ; Misc. eywords used with various commands: 357 | On 358 | Off 359 | All 360 | 361 | ; Registry root keys: 362 | HKEY_LOCAL_MACHINE 363 | HKEY_USERS 364 | HKEY_CURRENT_USER 365 | HKEY_CLASSES_ROOT 366 | HKEY_CURRENT_CONFIG 367 | HKLM 368 | HKU 369 | HKCU 370 | HKCR 371 | HKCC 372 | 373 | ; Registry value types: 374 | REG_SZ 375 | REG_EXPAND_SZ 376 | REG_MULTI_SZ 377 | REG_DWORD 378 | REG_BINARY 379 | 380 | ; Objects 381 | class 382 | new 383 | extends 384 | -------------------------------------------------------------------------------- /syntax-files/TotalHLT/ahk.lang: -------------------------------------------------------------------------------- 1 | # AutoHotkey language definition file 2 | # ------------------------------------------ 3 | # This file is a part of highlight, a free source code converter released under the GPL. 4 | # 5 | # The file is used to describe keywords and special symbols of programming languages. 6 | # See README in the highlight directory for details. 7 | # 8 | # New definition files for future releases of highlight are always appreciated ;) 9 | # 10 | # ---------- 11 | # andre.simon1@gmx.de 12 | # http:/www.andre-simon.de/ 13 | # 14 | # About TotalHLT & Total Commander 15 | # TotalHLT (Total Highlight) is a Lister plugin for Total Commander. 16 | # The major function is to display source code files with syntax highlight. 17 | # Available on totalcmd.net at http://www.totalcmd.net/plugring/hlight.html 18 | # 19 | # You might need to add the following line to "extensions.conf" 20 | # $ahk=ahk 21 | 22 | $KW_LIST(kwa)=goto gosub break return continue default if else while for throw try catch true false 23 | useerrorlevel between contains join alwaysontop caption border owner show mouse screen pixel caret 24 | relative window client delimiter disabled dpiscale hwndoutputvar lastfound lastfoundexist maximizebox 25 | minimizebox minsize maxsize owndialogs owner parent resize sysmenu theme toolwindow 26 | 27 | # could add styles such as e0x80000 http://ahkscript.org/docs/misc/Styles.htm 28 | 29 | $KW_LIST(kwb)=abs autotrim asin acos atan blockinput break catch ceil click clipwait 30 | comobjactive comobjarray comobjconnect comobjcreate comobjenwrap comobjunwrap 31 | comobjerror comobjflags comobjget comobjmissing comobjparameter comobjquery 32 | comobjtype comobjvalue continue control controlclick controlfocus controlget 33 | controlgetfocus controlgetpos controlgettext controlmove controlsend controlsendraw 34 | controlsettext coordmode cos critical detecthiddentext detecthiddenwindows dllcall 35 | drive driveget drivespacefree edit else envadd envdiv envget envmult envset envsub 36 | envupdate exit exitapp exp fileappend filecopy filecopydir filecreatedir filecreateshortcut 37 | filedelete fileencoding fileinstall filegetattrib filegetshortcut filegetsize filegettime 38 | filegetversion filemove filemovedir fileopen fileread filereadline filerecycle 39 | filerecycleempty fileremovedir fileselectfile fileselectfolder filesetattrib filesettime 40 | finally floor format formattime func getkeyname getkeyvk getkeysc getkeystate groupactivate 41 | groupadd groupclose groupdeactivate gui guicontrol guicontrolget hotkey ifequal ifnotequal 42 | ifexist ifnotexist fileexist ifgreater ifgreaterorequal ifinstring instr ifless iflessorequal 43 | ifmsgbox ifwinactive ifwinnotactive ifwinexist ifwinnotexist imagesearch inidelete iniread 44 | iniwrite input inputbox isbyref isfunc islabel isobject keyhistory keywait listhotkeys listlines 45 | listvars log ln loop menu mod mouseclick mouseclickdrag mousegetpos mousemove msgbox numget 46 | numput onexit onmessage outputdebug pause pixelgetcolor pixelsearch postmessage process progress 47 | random regexmatch regexreplace regdelete regread regwrite registercallback reload return round 48 | run runas runwait send sendraw sendinput sendplay sendlevel sendmessage sendmode setbatchlines 49 | setcapslockstate setcontroldelay setdefaultmousespeed setenv setformat setkeydelay setmousedelay 50 | setnumlockstate setscrolllockstate setregview setstorecapslockmode settimer settitlematchmode 51 | setwindelay setworkingdir shutdown sin sleep sort soundbeep soundget soundgetwavevolume soundplay 52 | soundset soundsetwavevolume splashimage splashtexton splashtextoff splitpath sqrt statusbargettext 53 | statusbarwait strput strget stringcasesense stringgetpos stringleft stringlen strlen stringlower 54 | stringmid substr stringreplace stringright stringsplit stringtrimleft stringtrimright stringupper 55 | suspend sysget tan thread throw tooltip transform traytip trim rtrim ltrim try until urldownloadtofile 56 | varsetcapacity while winactivate winactivatebottom winactive winclose winexist wingetactivestats 57 | wingetactivetitle wingetclass winget wingetpos wingettext wingettitle winhide winkill winmaximize 58 | winmenuselectitem winminimize winminimizeall winminimizeallundo winmove winrestore winset 59 | winsettitle winshow winwait winwaitactive winwaitclose winwaitnotactive 60 | 61 | $kw_list(kwc)=a_space a_tab a_workingdir a_scriptdir a_scriptname a_scriptfullpath a_scripthwnd 62 | a_linenumber a_linefile a_thisfunc a_thislabel a_ahkversion a_ahkpath a_isunicode 63 | a_iscompiled a_exitreason a_yyyy a_mm a_dd a_mmmm a_mmm a_dddd a_ddd a_wday a_yday 64 | a_yweek a_hour a_min a_sec a_msec a_now a_nowutc a_tickcount a_issuspended a_ispaused 65 | a_iscritical a_batchlines a_titlematchmode a_titlematchmodespeed a_detecthiddenwindows 66 | a_detecthiddentext a_autotrim a_stringcasesense a_fileencoding a_formatinteger 67 | a_formatfloat a_keydelay a_windelay a_controldelay a_mousedelay a_defaultmousespeed 68 | a_regview a_iconhidden a_icontip a_iconfile a_iconnumber a_timeidle a_timeidlephysical 69 | a_gui a_guicontrol a_guiwidth a_guiheight a_guix a_guiy a_guievent a_guicontrolevent 70 | a_eventinfo a_thismenuitem a_thismenu a_thismenuitempos a_thishotkey a_priorhotkey 71 | a_priorkey a_timesincethishotkey a_timesincepriorhotkey a_endchar comspec a_temp 72 | a_ostype a_osversion a_is64bitos a_ptrsize a_language a_computername a_username 73 | a_windir a_programfiles or programfiles a_appdata a_appdatacommon a_desktop 74 | a_desktopcommon a_startmenu a_startmenucommon a_programs a_programscommon a_startup 75 | a_startupcommon a_mydocuments a_isadmin a_screenwidth a_screenheight a_screendpi 76 | a_ipaddress1 a_ipaddress2 a_ipaddress3 a_ipaddress4 a_cursor a_caretx a_carety 77 | a_lasterror a_index a_loopreadline a_loopfield a_loopfilename a_loopfileext 78 | a_loopfilefullpath a_loopfilelongpath a_loopfileshortpath a_loopfileshortname 79 | a_loopfiledir a_loopfiletimemodified a_loopfiletimecreated a_loopfiletimeaccessed 80 | a_loopfileattrib a_loopfilesize a_loopfilesizekb a_loopfilesizemb a_loopregname 81 | a_loopregtype a_loopregkey a_loopregsubkey a_loopregtimemodified 82 | clipboard clipboardall errorlevel 83 | win_7 win_8 win_8.1 win_vista win_2003 win_xp win_2000 win_nt4 win_95 win_98 win_me 84 | 85 | $STRINGDELIMITERS=" 86 | 87 | $SL_COMMENT=; 88 | 89 | $ML_COMMENT=/* */ 90 | 91 | $ALLOWNESTEDCOMMENTS=true 92 | 93 | $IGNORECASE=true 94 | 95 | $DIRECTIVE=# 96 | 97 | $ESCCHAR=` 98 | 99 | $SYMBOLS= ( ) [ ] { } , ; . : & | < > ! = / * % + - 100 | 101 | $REFORMATTING=true 102 | -------------------------------------------------------------------------------- /editors/EditPlus2/Edit2.ahk: -------------------------------------------------------------------------------- 1 | /* 2 | Install AutoHotkey syntax highlighting and clip library files in EditPlus 2 3 | Mike Griffin 4 | Source: AHK Basic installer (extras\editors\editplus) 5 | 6 | ------- 7 | 8 | Mod for AHK v1.1+ 9 | Download syntax files from GH and create 10 | - AutoHotkey.stx 11 | before continuing installation 12 | (- AutoHotkey.ctl discarded atm) 13 | 14 | */ 15 | 16 | SetBatchLines,-1 ;fastest! 17 | title = Install EditPlus Syntax & Cliptext Files for AutoHotkey 18 | 19 | RegRead,EditPlusDir,HKEY_CURRENT_USER,Software\ES-Computing\EditPlus 2\Install,Path 20 | StringTrimRight,EditPlusDir,EditPlusDir,1 21 | ; Don't bother since %ProgramFiles% doesn't exist on Win95/98 and EditPlus should always 22 | ; have registry entries if it was installed properly: 23 | ;IfEqual,EditPlusDir,,SetEnv,EditPlusDir,%ProgramFiles%\EditPlus 2 ; Try a best-guess location. 24 | IfNotExist,%EditPlusDir% 25 | { 26 | MsgBox,16,%title%,EditPlus directory could not be found - It may not be installed 27 | Exit 28 | } 29 | 30 | ; Prompt the user to run the script 31 | MsgBox,36,%title%,Do you want to install EditPlus syntax and cliptext files for AutoHotkey scripts, and configure EditPlus to use them? 32 | IfMsgBox,No,Exit 33 | IfMsgBox,Cancel,Exit 34 | 35 | ; -------------[updated section]------------------- 36 | 37 | GetAHKSyntaxFiles() 38 | ; we now have Commands.txt,Directives.txt,Functions.txt,Keywords.txt,Variables.txt,Keys.txt 39 | ; now we can start making AutoHotkey.stx (based on old example) 40 | 41 | stx= 42 | ( 43 | #TITLE=AutoHotkey 44 | ; AutoHotkey syntax file 45 | #DELIMITER=,``=:\{} 46 | #QUOTATION1=" 47 | #QUOTATION2=`% 48 | #LINECOMMENT=; 49 | #COMMENTON=/* 50 | #COMMENTOFF=*/ 51 | #ESCAPE=`` 52 | 53 | 54 | #KEYWORD=Commands and Directives 55 | 56 | ) 57 | 58 | FileRead, directives, Directives.txt 59 | directives:=RegExReplace(directives,"m)^","^") 60 | stx .= directives "`n" 61 | FileRead, commands, Commands.txt 62 | FileRead, variables, Variables.txt 63 | FileRead, keywords, Keywords.txt 64 | stx .= commands "`n`n#KEYWORD=Special Keywords`n" 65 | stx .= keywords "`n" variables "`n`n#KEYWORD=Key Codes`n" 66 | FileRead, keys, Keys.txt 67 | keys:=RegExReplace(keys "`n","m)^(.*)$","{$1}`n$1") 68 | keys:=RegExReplace(keys,"\x5e\s\n") ; ^ 69 | keys:=RegExReplace(keys,"\x2b\s\n") ; + 70 | keys:=RegExReplace(keys,"\x21\s\n") ; ! 71 | keys:=RegExReplace(keys,"\x23\s\n") ; # 72 | keys:=RegExReplace(keys,"\x60\s\n") ; ` 73 | keys:=RegExReplace(keys,"\x7e\s\n") ; ~ 74 | keys:=RegExReplace(keys,"\x24\s\n") ; $ 75 | stringreplace,keys,keys,{}`n, 76 | stringreplace,keys,keys,{`n}`n, 77 | stx .= keys "`n`n#`n" 78 | 79 | FileDelete, AutoHotkey.stx 80 | FileAppend, %stx%, AutoHotkey.stx 81 | 82 | ; /-------------[updated section]------------------- 83 | 84 | FileCopy,AutoHotkey.stx,%EditPlusDir%,1 85 | 86 | if ErrorLevel <> 0 87 | { 88 | MsgBox,16,%title%,Could not copy AutoHotkey.stx 89 | Exit 90 | } 91 | 92 | ;FileCopy,AutoHotkey.ctl,%EditPlusDir%,1 93 | ;if ErrorLevel <> 0 94 | ;{ 95 | ; MsgBox,16,%title%,Could not copy AutoHotkey.ctl 96 | ; Exit 97 | ;} 98 | 99 | ; Now add or update EditPlus settings 100 | File=%EditPlusDir%\setting.ini 101 | IniRead,X,%File%,Settings,Custom 102 | if X = Error ; Probably due to setting.ini not existing, which happens if EditPlus was just freshly installed. 103 | X = 1 104 | Sect=Settings\Custom%X% 105 | 106 | Loop,%X% 107 | { 108 | XX=%A_Index% 109 | IniRead,desc,%File%,Settings\Custom%XX%,Description 110 | IfEqual,desc,AutoHotkey 111 | { 112 | Sect=Settings\Custom%XX% 113 | AlreadyConfigured=1 114 | Break 115 | } 116 | } 117 | 118 | ; Set up the configuration 119 | IniWrite,ahk`;aut,%File%,%Sect%,Extension 120 | IniWrite,AutoHotkey,%File%,%Sect%,Description 121 | ;Causes an error dialog when used with a fresh installation of EditPlus: IniWrite,%A_Space%,%File%,%Sect%,File 122 | IniWrite,4,%File%,%Sect%,Tab 123 | IniWrite,2,%File%,%Sect%,Indent 124 | IniWrite,80,%File%,%Sect%,Margin 125 | IniWrite,1,%File%,%Sect%,Word Wrap 126 | IniWrite,1,%File%,%Sect%,Auto Indent 127 | IniWrite,0,%File%,%Sect%,Tab Indent 128 | IniWrite,0,%File%,%Sect%,Common 129 | IniWrite,123,%File%,%Sect%,Indent Open 130 | IniWrite,125,%File%,%Sect%,Indent Close 131 | IniWrite,0,%File%,%Sect%,End of Statement 132 | ; Seems unnecessary: IniWrite,%A_Space%,%File%,%Sect%,Function 133 | IniWrite,%EditPlusDir%\AutoHotkey.stx,%File%,%Sect%,Syntax file 134 | IniWrite,1,%File%,%Sect%,Insert Space 135 | IniWrite,0,%File%,%Sect%,Hard break 136 | IniWrite,0,%File%,%Sect%,Wrap at Column 137 | IniWrite,0,%File%,%Sect%,Column Marker 1 138 | IniWrite,0,%File%,%Sect%,Column Marker 2 139 | IniWrite,0,%File%,%Sect%,Column Marker 3 140 | IniWrite,0,%File%,%Sect%,Column Marker 4 141 | IniWrite,0,%File%,%Sect%,Column Marker 5 142 | IniWrite,16711680,%File%,%Sect%,0 143 | IniWrite,255,%File%,%Sect%,1 144 | IniWrite,8421376,%File%,%Sect%,2 145 | IniWrite,32896,%File%,%Sect%,3 146 | IniWrite,128,%File%,%Sect%,4 147 | IniWrite,32768,%File%,%Sect%,5 148 | IniWrite,32768,%File%,%Sect%,6 149 | IniWrite,32768,%File%,%Sect%,7 150 | IniWrite,32768,%File%,%Sect%,8 151 | IniWrite,8388736,%File%,%Sect%,9 152 | IniWrite,255,%File%,%Sect%,10 153 | IniWrite,8388736,%File%,%Sect%,11 154 | IniWrite,8388736,%File%,%Sect%,12 155 | IniWrite,8388736,%File%,%Sect%,13 156 | IniWrite,8388736,%File%,%Sect%,14 157 | IniWrite,8388736,%File%,%Sect%,15 158 | IniWrite,16711935,%File%,%Sect%,16 159 | 160 | IniWrite,0,%File%,Settings,Disable Syntax 161 | 162 | If AlreadyConfigured <> 1 163 | { 164 | X++ 165 | IniWrite,%X%,%File%,Settings,Custom 166 | } 167 | 168 | ; Now prompt to make EditPlus the default editor for ahk files 169 | DefaultEditor: 170 | MsgBox,36,%title%,Do you want to make EditPlus the default editor for AutoHotkey scripts? 171 | IfMsgBox,Yes,RegWrite,REG_SZ, HKEY_CLASSES_ROOT,AutoHotkeyScript\Shell\Edit\Command,,"%EditPlusDir%\EditPlus.exe" "`%1" 172 | 173 | MsgBox,64,%title%,Installation complete! 174 | 175 | 176 | /* 177 | 178 | Part of the AutoHotkey Editors project: 179 | https://github.com/ahkscript/AutoHotkey-Editors/ 180 | 181 | This function downloads several text files from GH and it 182 | removes empty lines and comments so that there is one keyword 183 | per line. 184 | 185 | Each "type" has its own file: 186 | Commands, Directives, Functions, Keywords, Variables, Keys 187 | 188 | */ 189 | GetAHKSyntaxFiles() { 190 | FileDelete, tmpfile$$$.htm 191 | FileList:="Commands,Directives,Functions,Keywords,Variables,Keys" 192 | Loop, parse, FileList, CSV 193 | { 194 | URLDownloadToFile, https://raw.github.com/ahkscript/AutoHotkey-Editors/master/%A_LoopField%.txt, tmpfile$$$.txt 195 | FileRead, File, tmpfile$$$.txt 196 | File:=RegExReplace(RegExReplace(File, "`nm)^;.+\R" ), "`nm)^\n" ) ; remove empty lines and comments 197 | FileDelete, %A_LoopField%.txt 198 | FileAppend, %File%, %A_LoopField%.txt 199 | FileDelete, tmpfile$$$.txt 200 | File:="" 201 | } 202 | } 203 | --------------------------------------------------------------------------------