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.

1

1 Answer 1

70

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

5
  • 2
    Worked great on 2019-5-7 on win10 npp 7.6.6
    – m1m1k
    May 8, 2019 at 2:11
  • The way "block comments" are defined in the linked script breaks AHK portable 2.2.0.0
    – virtualxtc
    Oct 12, 2019 at 16:11
  • 1
    Is there any way to include AHK in the Style Configurator? Mar 5, 2020 at 7: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, 2020 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 Jan 18 at 21:14

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.