Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Notepad++ syntax highlighting for gnuplot

3,046 views
Skip to first unread message

Karl Heinz Schloeglmann

unread,
Jul 24, 2008, 6:03:47 AM7/24/08
to
Hi,

find enclosed a Notepad++ [1] syntax highlighting for gnuplot code.

You only have to build the file userDefineLang.xml and put it into

C:\Dokumente und Einstellungen\<user>\Anwendungsdaten\Notepad++
C:\Documents and Settings\<user>\Local Settings\Notepad++

Regards,
Karl

File: userDefineLang.xml
-----------8<----------------------------------
<NotepadPlus>
<UserLang name="gnuplot" ext="plt gnu gnuplot gp">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="yes" words2="yes" words3="yes" words4="yes" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">[&quot;0]&quot;0</Keywords>
<Keywords name="Folder+"></Keywords>
<Keywords name="Folder-"></Keywords>
<Keywords name="Operators">- ! $ % &amp; * , . / : ? \ ^ |
~ + &lt; = &gt;</Keywords>
<Keywords name="Comment">1## 1# 1# 2 0## 0# 0#</Keywords>
<Keywords name="Words1">BUILT-IN-VARIABLES: angles arrow
autoscale bars bmargin border boxwidth clabel clip cntrparam colorbox
contour datafile decimalsign dgrid3d dummy encoding fit fontpath format
functions function grid hidden3d historysize isosamples key label
lmargin loadpath locale logscale mapping margin mouse multiplot mx2tics
mxtics my2tics mytics mztics notitle offsets origin output parametric
plot pm3d palette pointsize polar print rmargin rrange samples size
style surface terminal tics ticslevel ticscale timestamp timefmt title
tmargin trange urange variables version view vrange x2data x2dtics
x2label x2mtics x2range x2tics x2zeroaxis xdata xdtics xlabel xmtics
xrange xtics xzeroaxis y2data y2dtics y2label y2mtics y2range y2tics
y2zeroaxis ydata ydtics ylabel ymtics yrange ytics yzeroaxis zdata
zdtics cbdata cbdtics zero zeroaxis zlabel zmtics zrange ztics cblabel
cbmtics cbrange cbtics</Keywords>
<Keywords name="Words2">COMMANDS: cd call clear exit fit
help history if load pause plot using u with w index every smooth thru
print pwd quit replot reread reset save set show unset shell splot
system test unset update</Keywords>
<Keywords name="Words3">FUNCTIONS: abs acos acosh arg asin
asinh atan atan2 atanh besj0 besj1 besy0 besy1 ceil cos cosh erf erfc
exp floor gamma ibeta inverf igamma imag invnorm int lambertw lgamma log
log10 norm rand real sgn sin sinh sqrt tan tanh column defined tm_hour
tm_mday tm_min tm_mon tm_sec tm_wday tm_yday tm_year valid</Keywords>
<Keywords name="Words4"></Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000"
bgColor="C0C0C0" fontName="" fontStyle="0" />
<WordsStyle name="FOLDERCLOSE" styleID="13"
fgColor="000000" bgColor="C0C0C0" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="FF00FF"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="0000FF"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="008000"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="FF8000"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="808080"
bgColor="FFFFFF" fontName="Comic Sans MS" fontStyle="0" fontSize="8" />
<WordsStyle name="COMMENT LINE" styleID="2"
fgColor="808080" bgColor="E9E9E9" fontName="Courier New" fontStyle="0"
fontSize="8" />
<WordsStyle name="NUMBER" styleID="4" fgColor="FF0000"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="8000FF"
bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="000000"
bgColor="FDFED6" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000"
bgColor="FFEAD5" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000"
bgColor="FFFFFF" fontName="" fontStyle="0" />
</Styles>
</UserLang>
</NotepadPlus>
-----------8<----------------------------------

[1] http://notepad-plus.sourceforge.net/de/site.htm

--
_ _ _ _ ____
| |/ /arl|_| | | _| Civil Engineer & PhD-Student
| | | _ |einz \ Graz, Austria
|_|\_\ |_| |_| |____|chloeglmann http://www.schloeglmann.at

Tim Hoffmann

unread,
Jul 25, 2008, 11:01:58 PM7/25/08
to Karl Heinz Schloeglmann
Hi Karl,

nice to see, that there are more people using Notepad++ to create their
gnuplot scripts. I have some proposals for your language file:

1) add 'dem' to the list of extensions (demo files).
2) set Prefix words to no, except for
3) <Prefix words1="no" words2="no" words3="no" words4="yes" />
...
<Keywords name="Words4">$</Keywords>
This renders $0 $1 ... in an own style. Though technically $ is an
operator I find this very convenient.

4) Following is a list of my additions to the word lists:

commands:
+ else
+ lower
+ raise
+ refresh
+ screendump
+ smooth
+ via
// you've got unset twice

variables:
+ acsplines
+ bezier
+ binary
+ csplines
+ frequency
+ macros
+ matrix
+ object
+ sbeszier
+ table
+ termoption
+ unique
+ xyplane
+ zzeroaxis
- fit
- plot
// technically they are both commands and variables, but I would just
define them once in commands:

functions:
+ exists
+ gprintf
+ sprintf
+ stringcolumn
+ strlen
+ strstrt
+ substr
+ system
+ word
+ words
+ pi // didn't know where to put this. A constant function if you want.

constants (add them to functions or use Words4, if you do not want to
put $ there):
FIT_CONVERGED
FIT_LAMBDA_FACTOR
FIT_LIMIT
FIT_LOG
FIT_MAXITER
FIT_NDF
FIT_SCRIPT
FIT_START_LAMBDA
FIT_STDFIT
FIT_WSSR
GNUTERM
MOUSE_ALT
MOUSE_BUTTON
MOUSE_CHAR
MOUSE_CTRL
MOUSE_KEY
MOUSE_SHIFT
MOUSE_X
MOUSE_X2
MOUSE_Y
MOUSE_Y2
GPVAL_CB_LOG
GPVAL_CB_MAX
GPVAL_CB_MIN
GPVAL_CB_REVERSE
GPVAL_COMPILE_OPTIONS
GPVAL_LAST_PLOT
GPVAL_MULTIPLOT
GPVAL_OUTPUT
GPVAL_PATCHLEVEL
GPVAL_PLOT
GPVAL_SPLOT
GPVAL_TERM
GPVAL_TERMOPTIONS
GPVAL_T_LOG
GPVAL_T_MAX
GPVAL_T_MIN
GPVAL_T_REVERSE
GPVAL_U_LOG
GPVAL_U_MAX
GPVAL_U_MIN
GPVAL_U_REVERSE
GPVAL_VERSION
GPVAL_VIEW_MAP
GPVAL_VIEW_ROT_X
GPVAL_VIEW_ROT_Z
GPVAL_VIEW_SCALE
GPVAL_VIEW_ZSCALE
GPVAL_V_LOG
GPVAL_V_MAX
GPVAL_V_MIN
GPVAL_V_REVERSE
GPVAL_X2_LOG
GPVAL_X2_MAX
GPVAL_X2_MIN
GPVAL_X2_REVERSE
GPVAL_X_LOG
GPVAL_X_MAX
GPVAL_X_MIN
GPVAL_X_REVERSE
GPVAL_Y2_LOG
GPVAL_Y2_MAX
GPVAL_Y2_MIN
GPVAL_Y2_REVERSE
GPVAL_Y_LOG
GPVAL_Y_MAX
GPVAL_Y_MIN
GPVAL_Y_REVERSE
GPVAL_Z_LOG
GPVAL_Z_MAX
GPVAL_Z_MIN
GPVAL_Z_REVERSE
GPVAL_TERMINALS

5) Actually I consider gnuplot scripts as sort of programming with a
write-test-release cycle. So I configured Notepad++ as my gnuplot-IDE. I
use a batch file and two gnuplot files as a small framework to plot to
screen or file. This can be called form within Notepad++ by shortcuts.
Though it's not in a release state it's already quite handy. Also the
most annoying problem (no error output in windows) can be solved now by
logging the console output of wgnuplot to a file (submitted as patch
1996818).
If there is interest I can post details when I'm back from holiday.

Regards,
Tim

Tim Hoffmann

unread,
Jul 25, 2008, 11:03:21 PM7/25/08
to Karl Heinz Schloeglmann
0 new messages