Syntax Highlighting Sharing

From Notepad++ Wiki
Jump to: navigation, search
How to share a syntax highlighting scheme

How to share an user defined language?

Follow the instructions below:

  1. On the source PC, open Notepad++, display its Uder Defined Language panel, and select the language to share.
  2. Click the Export... button, and enter a file name. The language definition is now in its own .xml file.
  3. Copy the newly generated file to the destination PC.
  4. On the destination PC, open the User Defined Language panel, click Import... and choose the file that was just copied.

Older versions

Versions of Notepad++ prior to 5.7 are not able to import or export language definitions to individual files. The following procedure then applies:

  1. Open the file with the language to import.
  2. The language definition is bracketed between <UserLang name=..> and </UserLang> tags. Copy this section.
  3. Now open userDefineLang.xml and paste the copied text there, just before a <UserLang name=..> tag or the closing </Notepad++> tag.

In the special case where <tt>userDefineLang.xml did not previously exist, the procedure is even simpler: just rename or copy the language file as userDefineLang.xml.

What about highlighting of builti-in languages?

For sharing the syntax highlighting for a built-in language, follow the same procedure as above, but replace userDefineLang.xml wih stylers.xml if using the default theme, or the alternate theme file with your highlighting preferences. Also, <UserLang> tags are named <Language> instead. The new style data should replace the old, becuse the ordering in stylers.xml>/tt> matches the one in <tt>langs.xml.

Note that a theme file contains data for all supported languages; there is no obvious way to mix and match different themes, apart from copy and paste to a new ad hoc file.

When you copy language settings, you also copy the indication of whether the language should be displayed in the Language menu. You can always adjust this sort of issues from the Settings -> Preferences -> Language Menu/Tab settings tab.