Notepad++ Custom Language Highlighting
Asked Answered
A

3

30

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..."?

Avelinaaveline answered 15/4, 2011 at 14:7 Comment(2)
I don't know about the xml spec but you can specify that under view->user define dialog; boundary open/closeLubricator
Did you check out this thread?Kelseykelsi
H
22

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.

Hullo answered 15/2, 2012 at 23:20 Comment(5)
The Notepad++ wiki seems to have disappeared. How to create your own definition (user-defined language) of a Syntax Highlighting scheme on Archive.orgKilometer
Thanks @Virtlink -- I've updated the link to use your version.Hullo
Current links are available from Notepad++ homepage / Resources, wikiTaynatayra
@Taynatayra That wiki link is dead too now, this one works for now: docs.notepad-plus-plus.org/index.php/User_Defined_LanguagesLumberyard
Currently, it's here: ivan-radic.github.io/udl-documentationSuperstition
C
4

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.

Catamaran answered 2/9, 2014 at 9:47 Comment(0)
H
2

I had log4net files that I wanted to view in Notepad++. They contained lines like:

2015-06-03 16:38:10,751 [Compname][Thread:29][FATAL]

To highlight [FATAL] just the keyword list wasn't enough. I added this: On tabpage "Folder & Default" > Folding in code style 1: >

Open: [ 
Close: ]

On tabpage "Keyword lists" > 1ste group > FATAL with some styling.

Hohenlohe answered 1/7, 2015 at 15:51 Comment(1)
folding is for folding the lines of code. To set the delimiter for strings (like ", ') use delimiter field insteadUnionist

© 2022 - 2024 — McMap. All rights reserved.