8

I have a custom XML style file for SAS, from a list of User Defined Language Files in Notepad++ available here : http://docs.notepad-plus-plus.org/index.php/User_Defined_Languages#How_To_Create_or_Modify_User-Defined_Languages

The file style: http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_SAS.xml

How can I tell Notepad++ to create a new custom language and use this file for the styling?

When I click on New User Defined Language (trying to call it SAS) I get this:

enter image description here

How can I tell it to use the style in the XML file for this new custom language?

I consulted the following questions, but they all concern changing the default behaviour, or manually defining a new language, not adding in a premade XMl file.

How to set the default language in Notepad++

How to set the default language in Notepad++

Adding a new language to Notepad++

How to get user defined language in Notepad++ to follow master formatting?

Chuck
  • 181

3 Answers3

6

In the main menu click Language/User Defined Language/Define your language... the window that you have a screenshot of on the right side will appear. Then click the Import... button near the top and browse to your .xml file and press Open.

A popup should appear that says "Import successful", press OK. You should now see your custom language listed in the dropdown list at the top of the window. You can make modifications to the syntax, fonts, colors, keywords, etc. Click the X to close this window when done.

In the main language menu, you should also be able to select your new language near the very bottom of the list, but notepad++ should automatically choose the proper one based on the file extension (close and reopen any files if not). It may also be useful to restart notepad++ entirely afterward.

MasterHD
  • 293
2

The XML file you show already contains complete definition of the UDL.

  1. Copy everything beetween tags <UserLang and </UserLang> also including them.

  2. Locate the file userdefinelang.xml. It is in the same directory as file contextMenu.xml which you can open using menu Settings > Edit Popup ContextMenu.

    • If the file was missing, just copy your file into that file and skip steps 3 and 4.
  3. Paste your selection just before </NotepadPlus> tag.

  4. Save and restart Notepad++.

  5. The language should appear near bottom of the Language menu.

miroxlav
  • 14,845
0

The Import button on the User Defined Language pop up was what worked for me. It prompted me for the xml file to import and then the language showed up after I exited and reopened Notepad++

Scott
  • 11