Notepad++

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Notepad++

#1 Post by Squashman » 02 Oct 2012 13:56

Not sure how many of you use Notepad++ to write your batch files but I find it very convenient for the syntax highlighting.
I was writing a new script today and noticed that it was not syntax highlighting some of the commands. Specifically the PUSHD, POPD & TITLE commands.
I went back and opened up a few other scripts I had written with N++ and the PUSHD & TITLE commands were highlighted but the POPD command was not.
I opened up another batch file and noticed SETLOCAL was not highlighted but in another batch it was.

All the file extensions are .BAT and the language is set for Batch in N++. I am completely stumped as to what the problem is.

Anyone else run into this issue?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Notepad++

#2 Post by foxidrive » 02 Oct 2012 16:12

I have N++ loaded but don't regularly use it

Can you post an example where the commands are not highlighted?

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Notepad++

#3 Post by abc0502 » 03 Oct 2012 03:00

I always use n++ to write batch files,
The highlighting depend on the style configuration, from the setting menu, try change the style for the batch files, i use zenburn and the setlocal, popd, and pushd is highlighted, but the set command and for and also many commands is just white color.

you can set the style by yourself.

aGerman
Expert
Posts: 4745
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Notepad++

#4 Post by aGerman » 03 Oct 2012 04:49

There are keywords and patterns to match for syntax highlighting. I tried out some different editors but each of them failed in some points.
E.g. N++ has problems with command concatenations
@echo off & setlocal
Echo is the keyword and the string next to it is parsed as the output of echo. Hence setlocal isn't highlighted.
set a=b &rem My comment.
Rem is a keyword but &rem isn't matched. Works with a space between & and rem.

I prefer more discreet highlighting. N++ is too colorful in my opinion. I use PSPad which - of course - failes as well in more or less the same cases :wink:

Regards
aGerman

Post Reply