Skip to content

Instantly share code, notes, and snippets.

@cjgunnar
Created December 31, 2024 20:09
Show Gist options
  • Select an option

  • Save cjgunnar/c45b304a494bc7f944191199908f3415 to your computer and use it in GitHub Desktop.

Select an option

Save cjgunnar/c45b304a494bc7f944191199908f3415 to your computer and use it in GitHub Desktop.
Notepad++ user-defined language file for the Bruker OPUS NT macro programming language, allowing decent syntax highlighting
<NotepadPlus>
<UserLang name="OPUS_NT_MACRO" ext="MTX" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00REM 01 02 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<Keywords name="Numbers, extras1"></Keywords>
<Keywords name="Numbers, extras2"></Keywords>
<Keywords name="Numbers, suffix1"></Keywords>
<Keywords name="Numbers, suffix2"></Keywords>
<Keywords name="Numbers, range"></Keywords>
<Keywords name="Operators1">= : ; * / ,</Keywords>
<Keywords name="Operators2">.EQ. .NE. .GT. .GTEQ. .LT. .LTEQ. .NOCASE_PARTOF. .CASE_PARTOF.</Keywords>
<Keywords name="Folders in code1, open"></Keywords>
<Keywords name="Folders in code1, middle"></Keywords>
<Keywords name="Folders in code1, close"></Keywords>
<Keywords name="Folders in code2, open"></Keywords>
<Keywords name="Folders in code2, middle"></Keywords>
<Keywords name="Folders in code2, close"></Keywords>
<Keywords name="Folders in comment, open"></Keywords>
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">&apos;VARIABLES SECTION&apos;&#x000D;&#x000A;&apos;PROGRAM SECTION&apos;&#x000D;&#x000A;&apos;PARAMETER SECTION&apos;</Keywords>
<Keywords name="Keywords2">STRING&#x000D;&#x000A;NUMERIC&#x000D;&#x000A;BOOL&#x000D;&#x000A;FILE&#x000D;&#x000A;BUTTON</Keywords>
<Keywords name="Keywords3"></Keywords>
<Keywords name="Keywords4"></Keywords>
<Keywords name="Keywords5"></Keywords>
<Keywords name="Keywords6"></Keywords>
<Keywords name="Keywords7"></Keywords>
<Keywords name="Keywords8"></Keywords>
<Keywords name="Delimiters">00&apos; 01 02&apos; 03&lt; 04 05&gt; 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" fgColor="808080" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="LINE COMMENTS" fgColor="808080" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="NUMBERS" fgColor="FF0000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS1" fgColor="000000" bgColor="FFFFFF" fontStyle="5" nesting="0" />
<WordsStyle name="KEYWORDS2" fgColor="000080" bgColor="FFFFFF" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="OPERATORS" fgColor="400040" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" fgColor="008040" bgColor="FFFFFF" fontStyle="0" nesting="2" />
<WordsStyle name="DELIMITERS2" fgColor="0000FF" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>
@cjgunnar
Copy link
Author

cjgunnar commented Dec 31, 2024

Description

This "user-defined language" file provides basic syntax highlighting for notepad++ when editing Bruker OPUS NT Macro files.

Preview

screenshot of notepad++ with syntax highlighting

As you can see, there is syntax highlighting for the sections, types, variables, numbers, and strings.names are in blue, strings in green, numbers in red.

Installation

  1. In notepad++: Language -> User Defined Language -> Open User Defined Language folder...
  2. Create a new text file in that folder called OPUS_NT_MACRO.xml, and paste the gist into it.
  3. Restart notepad++
  4. Now OPUS Macro files (extension .MTX) will be colored. You can also set the language manually under Language.

Customizing

If you want to change the colors, follow these steps:

  1. Language -> User Defined Language -> Define your language
  2. In the User language dropdown, select OPUS_NT_MACRO
  3. Press the styler buttons to change the colors for the background, font, keyword highlighting, etc (see docs for more details)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment