Notepad++ Mod Manager Language
Syntax-highlighting is a text editor feature in which different text colors are used to identify various syntactic element of a file (typically a computer language). It is distinctly useful for detecting and preventing syntax errors.
Notepad++, a powerful Windows-only text editor, has built-in syntax-highlighting rules for upwards of 50 computer languages. It also supports user-defined syntax-highlighting rules.
Notepad++ calls a set of syntax-highlighting rules a "language", and files that hold syntax-highlighting rules are "language files". Confusingly, Notepad++ "languages" do not have a 1:1 correspondence with "computer languages", because different rulesets, perhaps with different color schemes, can be applied, at different times, to any particular one computer language. To alleviate the confusion over the meaning of "language" in TNG, this article will generally refer to "language files" (meaning a stored set syntax-highlighting rules) and "computer languages".
TNG programmers have created two Notepad++ language files to control syntax highlighting for TNG Mod Manager .cfg files. The two language files have different color schemes, and one of the language files is for TNGv8-v11, while the other is for TNGv12 and above. (In truth, both language files can be used with any version of TNG, but the TNGv8-v11 language file cannot highlight the Mod Manager keywords that were introduced in TNGv10.1 and TNGv12.)
- For TNGv11 and before, download Mod-Manager.zip.
TNG version: ≤ 11.1.2
- For TNGv12 and later, download Mod-ManagerV12.zip
TNG version: ≥ 12.0.0
In both cases, you will need to extract an XML file from the zip archive. The location where you ultimately save your XML file will depend on the version of Notepad++ you are running.
Note that the instruction below are different for older and newer versions of Notepad++. The XML file you intend to use does not affect the instructions.
Notepad++ v6 and beyond (2014 and later)
- Save the XML file anywhere on your computer; perhaps in your downloads folder.
- In Notepad++
Language / Define your languagefrom the drop-down menus.
- On the pop-up form, just click on the
Importbutton near the top.
- If necessary, navigate to the folder in which you stored your XML file.
- Select the XML file that you just saved.
- Close the language definition form.
Notepad++ 220.127.116.11: (downloaded before 2014)
- Save the the XML file to
Desktop >> User >> AppData >> Roaming >> Notepad++, which is generally
- In Notepad++
View / User-Defined Dialog.
- Click the
Importbutton on the User-Defined Language screen.
- Select the XML file that you just saved.
The Open dialog should default to the folder in which you saved the XML file. If it does not, you'll have to navigate to it.
Files that are open for editing within Notepad++ when you install a language file will most likely not automatically take on the new highlighting; you'll need to close them and re-open them. In some cases, you may even need to close and reopen Notepad++.
TNGv12 Syntax Highlighting
|TNG version:||≥ 12.0.0|
The screen clip below illustrates that:
- All keywords in the .cfg file heading are blue, whether they existed before TNGv12 or not. (Lines 1-6)
- The word "description" in line 3 is highlighted as though it were a keyword. Mod Manager knows that all of its keywords must be preceded with a percent sign, but the Notepad++ Mod Manager language does not.
- Percent signs and colons, which are Mod Manager delimiters, are bold and brown, with a pale background. (Lines 1-6,16,etc.)
- As with the word "description" above, percent signs and colons are highlighted even when they are not serving as Mod Manager delimiters.
- The percent sign at the end of the %author directive is not highlighted. I don't know why.
- The keyword target and the target filename have a bright yellow background. (Lines 13&36)
- Note that the percent sign and keyword within the target directive are not highlighted in brown.
- location, insert, and replace (and their variations) are red. (Lines 16,19,29,32)
- end, and the before and after arguments for insert tags, are blue. (Lines 18,19,25,etc.)
- The new TNGv12 conditional keywords (e.g. fileexists and textexists) are green. (Line 38)
- The new TNGv12 label keyword is green with a light brown background. (Line 41,52)
Pre-TNGv12 Syntax Highlighting
|TNG version:||≤ 11.1.2|
The Notepad++ screen shot below illustrates that:
- The mod description is highlighted with a yellow background
- Percent signs and colons, which are Mod Manager delimiters, are shown in orange, even when they are not serving as delimiters. (See the text added at the end of line 14, just to illustrate this point.)
- Keywords in the mod's heading and the "Target" keyword are shown in green text - see lines 2, 3, 21, and 30. (But the "wikipage" keyword is not highlighted, because it was introduced to Mod Manager after the highlighting rules were defined.)
- Other keywords are shown in red-orange text - see lines 23, 24, 33, and 44
- (Note that the keyword "parameter" is highlighted in line 16 even though it is not being used as a Mod Manager keyword there. Mod Manager knows that all of its keywords must be preceded with a percent sign, but the Notepad++ Mod Manager language does not.
- Other keywords (insert, replace, triminsert, trimreplace) are shown in pink text - see line 36
- Why Use It ?
- Installing Config Files
- Batch Updates
- Interpreting Status
- Editing Parameters
- Deleting Mods
Mod Manager Controls
For Mod Developers
- Mod Guidelines
- Mod Manager Syntax
- Creating Config Files
- Config File Creation Example
- Avoiding Mod Conflicts
- Using the TNG File Analyzer
- Notepad++ Mod Manager Language