Syntax highlighting in Notepad ++: how to treat user language as an embedded language?

This is a very minor issue, which nevertheless annoys me for several months. I spent several hours sorting it out to no avail.

To enable syntax highlighting of .ahk files in Notepad ++, I downloaded and imported an XML file for AutoHotkey. The problem is that to enable this highlight, I have to manually select it from the "Language" drop-down list. I would like it to turn on whenever the .ahk file is open, as for other languages.

I tried adding the .ahk extension to the AutoIt language in the Style Configurator, which does nothing for me. Any ideas? I may not be the first person that annoyed me, but I could not ask Google with success.

+8
syntax highlighting notepad ++ autohotkey
source share
3 answers

It should work. Check again:

  • Go to Settings β†’ Style Configurator , select your language and add the User ext. extension User ext. ahk (no point!).
  • If this is a custom language, go to Language β†’ Define your language , then select Language β†’ Define your language from the drop-down list and in the text box named Ext. add the extension "ahk".
  • Make sure that the ahk extension is ONLY defined for AutoHotKey and not in two languages ​​at the same time (so remove the extension from AutoIt).
  • If it still does not work, check the version of Notepad ++. The latter is 6.5.1, previous versions may have an error.
+11
source share

To set syntax highlighting in Notepad ++ version 6 +:

  • In the main menu, go to the menu View> User language ...
  • Click the "Import ..." button.
  • View the syntax coloring file. It can be a .xml or .udl .
  • The message "Import Successful" will open.
  • Now open one of the configuration files in Notepad ++.
  • Voila! Colour!

If the file was created correctly, it should already include a link to the extension and automatically recognize new files and display them in the appropriate context. However, any files opened in nuclear power plants will not automatically display the new color highlighting until you close and open them.

Here is more detailed information about the activators of nuclear power plants .

A few more custom highlighters .

Otherwise, there might be something wrong with your udl file. You can try the one I made if you want.

+3
source share

My problem was that when importing a friend's file, the extension field associated with my user-defined language contained quotes around it: "mcr". I removed the quotes and now it works fine.

0
source share

All Articles