@@ -0,0 +1,182 @@
3+# http://www.sublimetext.com/docs/3/syntax.html
16+ - include: string_single
17+ - include: string_double
18+ - match: '\b(for)\b\s*(\[)'
20+ gnuplot iteration statement.
22+ numeric [n = 1:2{:inc}]
23+ string based [str in "x y z"]
24+ but both can also iterate over lists etc, so this is kept loose.
26+ 1: keyword.other.iteration.gnuplot
27+ 2: punctuation.definition.range.begin.gnuplot
29+ - meta_scope: meta.structure.iteration.gnuplot
32+ 0: punctuation.definition.range.end.gnuplot
36+ - include: string_double
37+ - include: string_single
39+ scope: punctuation.separator.range.gnuplot
40+ - match: '\b([a-zA-Z]\w*)\b\s*(=|in)'
41+ scope: variable-assignment.range.gnuplot
42+ - match: '(?i:[^\s(pi|e)\]])'
43+ scope: invalid.illegal.expected-range-separator.gnuplot
45+ comment: "gnuplot range statement [a:b]. Lots of things are legal, still more make no sense!"
47+ 0: punctuation.definition.range.begin.gnuplot
49+ - meta_scope: meta.structure.range.gnuplot
52+ 0: punctuation.definition.range.end.gnuplot
57+ scope: punctuation.separator.range.gnuplot
58+ - match: '(?i:[^\s(pi|e)\]])'
59+ scope: invalid.illegal.expected-range-separator.gnuplot
61+ scope: constant.character.escape.gnuplot
62+ - match: '(?<!\$)(#)(?!\{).*$\n?'
63+ scope: comment.line.number-sign.gnuplot
65+ 1: punctuation.definition.comment.gnuplot
67+ comment: introduce in gnuplot 4.3.
68+ scope: keyword.other.iteration.gnuplot
69+ - match: \b(angles|arrow|autoscale|bars|border|boxwidth|clabel|clip|cntrparam|colorbox|contour|decimalsign|dgrid3d|dummy|encoding|fit|format|grid|hidden3d|historysize|isosamples|key|label|locale|logscale|macros|bmargin|lmargin|rmargin|tmargin|mapping|mouse|multiplot|offsets|origin|output|palette|parametric|pm3d|pointsize|polar|print|rrange|trange|urange|vrange|samples|size|style|surface|tics|ticscale|ticslevel|timestamp|timefmt|title|view|xyplane|x2data|xdata|y2data|ydata|z2data|zdata|x2label|xlabel|y2label|ylabel|z2label|zlabel|x2range|xrange|y2range|yrange|z2range|zrange|mx2tics|mxtics|my2tics|mytics|mz2tics|mztics|nomx2tics|nomxtics|nomy2tics|nomytics|nomz2tics|nomztics|nox2tics|noxtics|noy2tics|noytics|noz2tics|noztics|x2tics|xtics|y2tics|ytics|z2tics|ztics|x2dtics|x2mtics|xdtics|xmtics|y2dtics|y2mtics|ydtics|ymtics|z2dtics|z2mtics|zdtics|zmtics|x2zeroaxis|xzeroaxis|y2zeroaxis|yzeroaxis|z2zeroaxis|zeroaxis|zzeroaxis|zero|)\b
70+ scope: keyword.other.setting.gnuplot
71+ - match: \b(cd|call|clear|exit|plot|splot|help|load|pause|quit|fit|replot|if|FIT_LIMIT|FIT_MAXITER|FIT_START_LAMBDA|FIT_LAMBDA_FACTOR|FIT_LOG|FIT_SCRIPT|print|pwd|reread|reset|save|show|test|!|functions|var)\b
72+ comment: missuse of scopes alert! Just for pretty colours
73+ scope: keyword.other.command.gnuplot
74+ - match: \b(abs|acos|acosh|arg|asin|asinh|atan|atan2|atanh|besj0|besj1|besy0|besy1|ceil|cos|cosh|erf|erfc|exp|floor|gamma|ibeta|igamma|imag|int|inverf|invnorm|lambertw|lgamma|log|log10|norm|rand|real|sgn|sin|sinh|sqrt|tan|tanh)\b
75+ scope: support.function.gnuplot
76+ - match: \b(gprintf|sprintf|strlen|strstrt|substr|system|word|words)\b
77+ scope: support.function.string.gnuplot
78+ - match: \b(on|off|default|inside|outside|lmargin|rmargin|tmargin|bmargin|at|left|right|center|top|bottom|center|vertical|horizontal|Left|Right|noreverse|noinvert|samplen|spacing|width|height|noautotitle|columnheader|title|noenhanced|nobox|linestyle|ls|linetype|lt|linewidth|lw)\b
79+ scope: constant.other.type.gnuplot
80+ - match: \b(aed512|aed767|aifm|aqua|bitgraph|cgm|corel|dumb|dxf|eepic|emf|emtex|epslatex|epson_180dpi|epson_60dpi|epson_lx800|fig|gif|gpic|hp2623A|hp2648|hp500c|hpdj|hpgl|hpljii|hppj|imagen|jpeg|kc_tek40xx|km_tek40xx|latex|mf|mif|mp|nec_cp6|okidata|pbm|pcl5|pdf|png|postscript|pslatex|pstex|pstricks|qms|regis|selanar|starc|svg|tandy_60dpi|tek40xx|tek410x|texdraw|tgif|tkcanvas|tpic|unknown|vttek)\b
81+ scope: constant.other.terminal.gnuplot
82+ - match: \b(u(sing)?|t(it(le)?)?|notit(le)?|w(i(th)?)?|steps|fs(teps)?|notitle|l(i(nes)?)?|linespoints|via)\b
83+ scope: keyword.modifier.gnuplot
86+ \b # Start with a word boundary
87+ (?=\b[\w$]*(\(|.*=)) # Look-ahead for a bracket or equals
88+ (?![^(]*\)) # negative look ahead for a closing bracket without an opening one. This stops a from matching in f(a)
89+ ( # Group variable name
91+ [\w$]* # Any word chars or $
92+ ) # That is it for the name.
94+ comment: user defined function / variable
95+ scope: variable.other.gnuplot
97+ scope: keyword.control.gnuplot
100+ 0: keyword.other.command.gnuplot
102+ - meta_scope: keyword.line.show.gnuplot
103+ - meta_content_scope: keyword.line.show.gnuplot
104+ - match: (?!\#)($\n?)
107+ - match: \b(set)\b\s*\b(terminal|term)\b
109+ 1: keyword.other.command.gnuplot
110+ 2: keyword.other.setting.gnuplot
112+ - meta_scope: keyword.line.set.terminal.gnuplot
113+ - match: (?!\#)($\n?)
116+ - match: \b(set)\b\s*\b(key)\b
118+ 1: keyword.other.command.gnuplot
119+ 2: keyword.other.setting.gnuplot
121+ - meta_scope: keyword.line.set.key.gnuplot
122+ - match: (?!\#)($\n?)
125+ - match: \b(set|unset)\b\s*(?!\b(terminal|key|for)\b)
127+ 1: keyword.other.command.gnuplot
128+ 2: keyword.other.setting.gnuplot
130+ - meta_scope: keyword.line.set.gnuplot
131+ - meta_content_scope: keyword.line.set.gnuplot
132+ - match: (?!\#)($\n?)
137+ (?x: # turn on extended mode
138+ -? # an optional minus
142+ [1-9] # a 1-9 character
143+ \d* # followed by zero or more digits
147+ \d+ # followed by one or more digits
149+ [eE] # an e character
150+ [+-]? # followed by an option +/-
151+ \d+ # followed by one or more digits
152+ )? # make exponent optional
153+ )? # make decimal portion optional
155+ comment: borrowed from textmate book
156+ scope: constant.numeric.gnuplot
158+ - match: \s*(==|~=|>|>=|<|<=|&|&&|:|\||\|\||\+|-|\*|\.\*|/|\./|\\|\.\\|\^|\.\^)\s*
159+ comment: Operator symbols
160+ scope: keyword.operator.symbols.matlab
164+ 0: punctuation.definition.string.begin.gnuplot
166+ - meta_scope: string.quoted.double.gnuplot
169+ 0: punctuation.definition.string.end.gnuplot
171+ - match: '\\[\$`"\\\n]'
172+ scope: constant.character.escape.gnuplot
176+ 0: punctuation.definition.string.begin.gnuplot
178+ - meta_scope: string.quoted.single.gnuplot
181+ 0: punctuation.definition.string.end.gnuplot