Notepad++ syntax highlighting

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
asciibard
Regular
Posts: 32
Joined: Tue Apr 03, 2012 4:33 pm
Contact:

Notepad++ syntax highlighting

#1 Post by asciibard » Tue Apr 10, 2012 8:22 am

Just wondering whether anyone has a better solution for syntax highlighting in Notepad++ on Windows. I've been choosing Python as my language which seems to change the colour of maybe half the commands I'm entering. Is there a Ren'Py-specific setting I can create or install that will change the colour of other commands?

User avatar
SusanTheCat
Miko-Class Veteran
Posts: 952
Joined: Mon Dec 13, 2010 9:30 am
Location: New Brunswick, Canada
Contact:

Re: Notepad++ syntax highlighting

#2 Post by SusanTheCat » Tue Apr 10, 2012 8:37 am

I have a syntax highlighting I created for Notepad. I'll post it here once I get home.

Quite a while ago I figured out how to get FunctionList to work with Ren'py
http://lemmasoft.renai.us/forums/viewto ... 5&#p116315

Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas

asciibard
Regular
Posts: 32
Joined: Tue Apr 03, 2012 4:33 pm
Contact:

Re: Notepad++ syntax highlighting

#3 Post by asciibard » Tue Apr 10, 2012 9:59 am

Many thanks, Susan. Can you verify from this screenshot that I followed your instructions correctly? Many of the commands are highlighted now but seemingly not all of them.

http://d.demodulated.com/renpad.png

Or was this just the first step and you'll be providing more files?

User avatar
SusanTheCat
Miko-Class Veteran
Posts: 952
Joined: Mon Dec 13, 2010 9:30 am
Location: New Brunswick, Canada
Contact:

Re: Notepad++ syntax highlighting

#4 Post by SusanTheCat » Tue Apr 10, 2012 10:51 am

I'll be providing more files once I'm at home. :)

Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas

User avatar
SusanTheCat
Miko-Class Veteran
Posts: 952
Joined: Mon Dec 13, 2010 9:30 am
Location: New Brunswick, Canada
Contact:

Re: Notepad++ syntax highlighting

#5 Post by SusanTheCat » Tue Apr 10, 2012 7:36 pm

I checked it against my current file and they are the same. The picture you posted looks the same as mine.
Screenshot_1.png
What keywords aren't showing for you?

You can add your own and/or create different colourings by going to the User-Defined Dialogue:
Screenshot_2.png
And adding them to the list:
Screenshot_3.png
I am going to take a moment and gush about Function List. I have it set up so it auto-detects labels. Then all I have to do is click on the label name in the function list and it takes me to that part of the code.

Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas

User avatar
Kitten the Cat
Regular
Posts: 60
Joined: Sun Jul 31, 2011 12:29 pm
Projects: The Onigami House [NaNo12], Beyond the Veil [NaNo14]
Organization: Riceball Games
Location: Sydney, Australia
Contact:

Re: Notepad++ syntax highlighting

#6 Post by Kitten the Cat » Tue Apr 10, 2012 10:14 pm

Oh this is useful! I love Notepad++ and would love to use it as my primary editor. ^_^

Thanks Susan ^^
Currently working on Beyond the Veil, our NaNoRenO '14 entry.
Image

asciibard
Regular
Posts: 32
Joined: Tue Apr 03, 2012 4:33 pm
Contact:

Re: Notepad++ syntax highlighting

#7 Post by asciibard » Wed Apr 11, 2012 9:49 am

Your suggestions are close to perfect and give me everything I need except for two things - highlighting inside curly braces and an indentation guide.

By curly braces, I'm referring to the modifiers for style and pauses. Maybe this isn't possible since those modifiers fall within double quotes. In a perfect world the highlighting would be smart enough to colour the text between the opening and terminating tags (e.g., everything between {b} and {/b}), and/or colouring the tags themselves.
Image

I had limited success defining the curly braces as delimiters, but this didn't colour any tags that reside within quotation marks.


By indentation guide I mean the collapsible heirarchical indicators that appear between the code and the line numbers that illustrate commands grouped by logical indentation.

Here's the RenPy language template with no indentation guide:
Image

Here's the Python language template with indentations indicated by the lines and collapsible minus icons [-].
Image

Do you happen to know any way to add or enable these guides? I monkeyed around but couldn't luck my way into it.

User avatar
SusanTheCat
Miko-Class Veteran
Posts: 952
Joined: Mon Dec 13, 2010 9:30 am
Location: New Brunswick, Canada
Contact:

Re: Notepad++ syntax highlighting

#8 Post by SusanTheCat » Wed Apr 11, 2012 11:13 am

Apparently the folding by indent level is hardcoded in Notepad++ for Python :( see http://stackoverflow.com/questions/7246 ... de-folding. It would be sweet tho.

Still looking

Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas

asciibard
Regular
Posts: 32
Joined: Tue Apr 03, 2012 4:33 pm
Contact:

Re: Notepad++ syntax highlighting

#9 Post by asciibard » Wed Apr 11, 2012 8:05 pm

Shame that a free open source program like Notepad++ wouldn't be more modular. I'm a noob and a sloppy coder so I've come to rely pretty heavily on that visual cue. I might take the middle road and use what you've taught me to customize the existing Python template to add a few Ren'Py commands.

Thanks sincerely for your help, Susan. Notepad++ is daunting but your helpful screenshots made it a snap.

User avatar
SusanTheCat
Miko-Class Veteran
Posts: 952
Joined: Mon Dec 13, 2010 9:30 am
Location: New Brunswick, Canada
Contact:

Re: Notepad++ syntax highlighting

#10 Post by SusanTheCat » Thu Apr 12, 2012 3:37 pm

I think you're on the right track.

For those of you following along at home, you can
* go to Settings => Style Configurator
* Pick Python
* click on KEYWORDS
* copy ren'py keywords into the user defined keywords box
* add rpy to the user ext box

Best of both worlds! Highlighting AND folding

And you can add the rules for function list to python.

Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]