Batch adding macros and syntax highlighting

  • Hello!
    How can I automatically add my macros and my syntax highlighting to the Notepad++?

  • @Alex-Woolf

    Macros are stored in shortcuts.xml and udls in userDefineLang.xml.


  • I know it. But I don’t know, how can I add new macros automatically.
    What about syntax highlighting?
    Where can I write it?
    And how can I add new syntax highlighting automatically.

  • @Alex-Woolf
    sorry, but I don’t understand your question.
    When creating a macro it is automatically saved in shortcuts.xml.
    You want to have these macros on another PC? Copy the file to that machine.
    Same applies to UDL.


  • Ok.
    Adding macro - ONLY by copying shortcuts.xml file. It’s not good, but this way is allowable.
    And what about syntax highlighting?

  • @Alex-Woolf,

    As @Claudia-Frank said, “Same applies to UDL”, and she said earlier that the custom syntax highlighting settings, which are known UDLs (User Defined Languages: Language > Define Your Language) are stored in userDefineLang.xml. You could either copy that single file to the new PC, or you could use the UDL window’s interface:

    1. Original PC: Language > Define Your Language
    2. Use the pulldown to select the User Language: ____ you want to transfer, and click the Export... button
    3. Copy that file on the new PC
    4. New PC: Language > Define Your Language: click the Import... button, and select that file
    5. Repeat for every UDL (syntax highlighting definition) that you want to transfer.

    If you’ve got more than one, it’s probably simplest to just copy the whole file, but if you only have one, or you don’t want to duplicate them all, you can do it using the UDL window.

    BTW: Since it wasn’t mentioned, those files are by default in %AppData%\Notepad++\, though if you’ve got a portable version of NPP, or if you chose to not use %AppData% when installing, they will be in the same folder as your notepad++.exe.

Log in to reply