45

I would like to display syntax highlighting for AutoHotkey .ahk script files in Notepad++.

I don't want to manually select a language every time I open an AHK script. I want language-specific syntax to be applied automatically when the file is opened.

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225

1 Answers1

67

Thanks to jNizM for their helpful guide on the AHK forums.

Setup Notepad++ for AutoHotkey

Syntax-Highlighting

  1. Download userDefineLang_AHK.xml as raw (Right-click and choosing save as target...)
  2. Start Notepad++ and click on Menu Language -> Define your language
  3. Click Import... and select the file you downloaded in step 1
  4. Restart Notepad++

AutoHotkey highlighting default theme

Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
  • 2
    Worked great on 2019-5-7 on win10 npp 7.6.6 – m1m1k May 08 '19 at 02:11
  • The way "block comments" are defined in the linked script breaks AHK portable 2.2.0.0 – virtualxtc Oct 12 '19 at 16:11
  • 1
    Is there any way to include AHK in the Style Configurator? – Wolfpack'08 Mar 05 '20 at 07:24
  • 2
    could anyone elucidate for me what the differences between the default and the "lazy" theme are? Is there a different functionality/philosophy in mind? – Some_Guy Oct 29 '20 at 16:51
  • I know jNizM and the AHK community is lucky to have him. If I had a dollar for each time one of his posts on the forums helped me solve a problem in my code, I could buy a new 4090 graphics card tonight. Great post @Stevoisiak! :D – GroggyOtter Jan 18 '23 at 21:14