Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ Custom Language Highlighting

I have a specific language (its private, and closed source) that I'm writing code highlighting for in Notepad++. I've never done anything like this before... so, for the most part, I'm clueless.

There are a bunch of keywords, and I've figured out how to implement those, but the strings are denoted by square brackets ([ and ]) instead of normal quotes. How do I register those as strings in the XML file?

Another thing, the language relies heavily on recursion and nesting; is there some way to say "Level 1 of the square brackets is this color, level 2 is this color, etc..."?

like image 300
Entity Avatar asked Apr 15 '11 14:04

Entity


People also ask

Does Notepad have syntax highlighting?

Like other text editors, Notepad++ (which is recommended by the basic tutorial) uses a system called Syntax Highlighting which helps in coding by visually identifying different parts of code with color.

How can I create my own notepad language?

Notepad++ makes it easy to create custom code and syntax highlighting for custom grammars and languages. After installation of the Notepad++ program, simply open the “Language” menu and select “Define your language…” from the drop-down.


2 Answers

There's a useful help page that explains how to use the GUI to define a custom language for Notepad++. As Alex K noted in a comment above, the option for setting string delimiters appears to be in the Delimiters boxes in the Operators tab. It doesn't look like it supports different colours for different levels of nesting, though.

like image 81
Matthew Strawbridge Avatar answered Sep 18 '22 00:09

Matthew Strawbridge


Update for those who have been asking the same question:

(Temporary) Documentation for custom syntax highlighting is on: http://udl20.weebly.com/index.html

There is a link to this in Notepad++ but it doesn't stand out.

like image 30
vogomatix Avatar answered Sep 20 '22 00:09

vogomatix