MTF Snippets syntax highlighting

The new MTF Snippets functionality in 12d Model allows for the creation of dynamic, intelligent and reusable objects that can be quickly and easily used in your design projects. Those writing, or even viewing, MTF snippets often do so in a text editor. To make it easier and clearer for snippet authors (aka snippeteers), I have created a User Defined Language (UDL) file for the excellent and highly-recommended Notepad++ text editor. This provides MTF Snippets syntax highlighting for any MTF Snippet files (file extension .mtfsnippet).

Updated! 9/01/2016 – Added support for code folding, a (near?) complete list of MTF commands and keywords and a few tweaks. Download the latest files below.
Example MTF Snippet in Notepad++ showing syntax highlighting
Example MTF Snippet in Notepad++ showing syntax highlighting


At the moment, the MTF Snippets syntax highlighting supports the following features:

  • Line and block comments
  • PARAMETER, DISPLAY and INFO special definitions
  • V10 C-preprocessor directives, e.g. #define, #ifdef
  • New V11 snippet preprocessor directives, e.g. @ def_tok , @ if_tok
  • Parameter and token substitution as $VAL and $(VAL)
  • Snippet-specific commands- variable, link_variable, user_message*
  • Snippet helper functions and mathematical functions, e.g. sin, rel_offset
  • Most, if not all, MTF Modifier commands, e.g. insert, remove, named_grade
  • Most, if not all, of the MTF Modifier keywords, e.g. absolute, extra_start, unknown

I will add features as they are added to 12d Model. The file is current for V11 C1h.


  1. Download the 12d MTF Snippets language file from the links below.
  2. Open Notepad++
  3. Select Language→Define your language… from the main menu
  4. From the panel that appears, click the Import button
  5. Browse for and select the file you downloaded
  6. If the import is successful, it should pop-up a dialog saying so.
  7. Close and restart Notepad++
  8. Any file with a .mtfsnippet extension should automatically use the new MTF Snippets syntax highlighting.
  9. Otherwise, to manually use the MTF Snippets syntax highlighting, select the Language→12d MTF Snippets menu item (near the bottom)

You can change the colours, fonts and styling used for the different categories and keywords by opening the Language→Define your language… panel in Notepad++ and clicking on the Styler buttons for the various sections.

Screenshots for instructions:

If you have any problems, feedback or requests, leave a comment below.

7 thoughts on “MTF Snippets syntax highlighting

  1. I followed the instructions for the 2nd time to update things.

    i got 2 copies of the mtfsnippet language and it wasnt clear which one I was using (the old one)

    Appears from my 2nd install of this that you need to delete one or both of the languages, restart notepad++ and then follow the instructions again. Even then I had to do step 9

    1. Ah, yes, sorry. I didn’t update the instructions. Thanks for that, Ed.

      I believe Step 9 should only be required the 1st time it’s done. I think Notepad++ needs to be restarted (exit then start again) to pick up the automatic syntax highlighting.

      I’ll try to update the instructions to reflect this.

  2. It appears to me that you have updated to include decision_xxxxx in the keywords 🙂 (I dont think it was there before)

    The reason I raised the update request was that I thought *decision_label* and *decision_goto* type commands should have an extra-obvious, eye catching highlighting. To my amateur programming mind, these are perhaps more significant place markers.

    But big ups to you for making these kinds of things available for mere plebs. Thanks

    1. Yes, a kind person (Mr. Gunter) gave me a list of all MTF keywords, so all the MTF stuff should now be in there.

      Code folding should also work for all the @ if / @ else / @ end_if stuff. I think I forgot the decision_then/decision_end stuff, though.

      For code folding, you can also use the special comments //<< and //>> to create custom regions. See the bottom of the updated screenshot above.

    2. Also, when I next feel so inclined, I’ll probably whip up a similar syntax highlighting file for just MTFs. That should allow for different colouring/styling of different sets of keywords not possible with the MTF Snippets stuff. For example, all the Fixed>Decisions commands could be a different style to the Fixed>Insert stuff. I just need to find some time and logically group the commands.

  3. Matt,

    I have a alternative Dark Themed variation of your syntax highlighting if you want it. I also have one for boxing (dark themed also).

    Let me know if you want to add them to the above?


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.