Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a custom programing language to NotepadQQ?

In NotepadQQ, I would like to add G-code and PLC (FBD, LD, ST, IL and SFC) programing language definitions/syntax code highlighting. Is this possible for a user to do this? How is it done? I found a post about how to add a language https://github.com/notepadqq/notepadqq/issues/164 but it is a bit beyond my knowledge base. Here is the gist of the post:

It's not possible to migrate XMLs from Notepad++ to Notepadqq. They're completely different formats. The best way is to write it from scratch.

This is the CodeMirror documentation for writing modes (aka syntax highlighters)

And this is an example of a syntax highlighter for makefiles written by a Notepadqq contributor

It seems some knowledge of a formating language is needed to create such a makefile. And I don't see how to implement it into notepadqq on my computer.

like image 442
Geoffrey Wheeler Avatar asked Dec 05 '25 04:12

Geoffrey Wheeler


1 Answers

NotepadQQ uses CodeMirror "modes" to handle language highlighting.

This page describes how to add them (a little out dated, look for Languages.json instead of Languages.js). https://github.com/notepadqq/notepadqq/wiki/How-to-let-Notepadqq-see-a-new-CodeMirror-language-(mode)

Look for those paths in your installation folder, which might be something like appdata/editor/...

It's probably easiest to select one of the existing languages that matches your new language and modify it to your needs.

You can find how to create modes here (they're just JavaScript): https://codemirror.net/demo/simplemode.html

like image 145
g01d Avatar answered Dec 07 '25 12:12

g01d



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!