1 | " Vim syntax file |
---|
2 | " Language: Singular |
---|
3 | " Maintainer: Henning Kopp <kopp@mathematik.uni-kl.de> |
---|
4 | " Last Change: 2011 Nov 09 |
---|
5 | " |
---|
6 | " HOW TO USE THIS FILE |
---|
7 | " Put this file into ~/.vim/syntax/singular.vim or |
---|
8 | " in your vim installation directory under syntax/singular.vim |
---|
9 | " |
---|
10 | " Then you can use the commands :syntax=singular |
---|
11 | " or :set filetype=singular to load the syntax highlighting for your |
---|
12 | " Singular file |
---|
13 | " If you are lazy, you should consider adding |
---|
14 | " map <special> <F12> :set filetype=singular<CR> |
---|
15 | " to your vimrc. Now you can enable singular syntax by pressing F12 |
---|
16 | " |
---|
17 | " Quit when a (custom) syntax file was already loaded |
---|
18 | if exists("b:current_syntax") |
---|
19 | finish |
---|
20 | endif |
---|
21 | |
---|
22 | syn sync fromstart |
---|
23 | "start highlighting from the start of the document |
---|
24 | |
---|
25 | "COMMENT |
---|
26 | syn region Comment start="//" end="$" |
---|
27 | " stuff behind a // up to the newline |
---|
28 | syn region Comment start="/\*" end="\*/" |
---|
29 | " stuff between /* and */ including newlines |
---|
30 | |
---|
31 | " CONSTANTS |
---|
32 | " Strings |
---|
33 | syn region String start=+"+ end=+"+ contains=infostring |
---|
34 | " infostring are special keywords in the library |
---|
35 | syn keyword infostring AUTHORS OVERVIEW REFERENCES KEYWORDS SEE\ ALSO PROCEDURES USAGE RETURN NOTE ASSUME EXAMPLE LIBRARY contained=String |
---|
36 | "contained=String |
---|
37 | hi link infostring SpecialComment |
---|
38 | " Highlight infostring as if it is a special comment |
---|
39 | " Library specific stuff |
---|
40 | syn keyword Label version category info |
---|
41 | "Numbers |
---|
42 | syn match Number "\d\+" |
---|
43 | "Floats |
---|
44 | syn match Float "[+-]\?\d\+\.\d*" " stuff like -12.05 |
---|
45 | syn match Float "[+-]\?\d\+\.\d*e[+-]\?\d\+" " stuff like +0.3e-2 or even 1.e-02 |
---|
46 | |
---|
47 | " IDENTIFIER |
---|
48 | " Functions, up to now just basic commands, no library functions |
---|
49 | syn keyword Function attrib |
---|
50 | syn keyword Function bareiss betti |
---|
51 | syn keyword Function char char_series charstr chinrem cleardenom close coef coeffs contract |
---|
52 | syn keyword Function datetime dbprint defined deg degree delete det diff dim division dump |
---|
53 | syn keyword Function eliminate eval ERROR example execute extgcd |
---|
54 | syn keyword Function facstd factmodd factorize farey fetch fglm fglmquot find finduni fprintf freemodule frwalk |
---|
55 | syn keyword Function gcd gen getdump groebner |
---|
56 | syn keyword Function help highcorner hilb homog hres |
---|
57 | syn keyword Function imap impart indepSet insert interpolation interred intersect |
---|
58 | syn keyword Function jacob janet jet |
---|
59 | syn keyword Function kbase kernel kill killattrib koszul |
---|
60 | syn keyword Function laguerre lead leadcoef leadexp leadmonom LIB lift liftstd listvar lres ludecomp luinverse lusolve |
---|
61 | syn keyword Function maxideal memory minbase minor minres modulo monitor monomial mpresmat mres mstd mult |
---|
62 | syn keyword Function nameof names ncols npars nres nrows nvars |
---|
63 | syn keyword Function open option ord ordstr |
---|
64 | syn keyword Function par pardeg parstr preimage prime primefactors print printf prune |
---|
65 | syn keyword Function qhweight qrds quote quotient |
---|
66 | syn keyword Function random rank read reduce regularity repart res reservedName resultant ringlist rvar |
---|
67 | syn keyword Function setring simplex simplify size slimgb sortvec sqrfree sprintf sres status std stdfglm stdhilb subst system syz |
---|
68 | syn keyword Function trace transpose type typeof |
---|
69 | syn keyword Function univariate uressolve |
---|
70 | syn keyword Function vandermonde var variables varstr vdim |
---|
71 | syn keyword Function waitall waitfirst wedge weight weightKB write |
---|
72 | |
---|
73 | " STATEMENT |
---|
74 | " Conditional |
---|
75 | syn keyword Conditional if else |
---|
76 | " Repeat |
---|
77 | syn keyword Repeat for while |
---|
78 | "Keyword, also known as stuff that fits nowhere else (within statements) |
---|
79 | syn keyword Keyword break breakpoint continue export exportto importfrom keepring load quit return ~ |
---|
80 | |
---|
81 | " TYPE |
---|
82 | syn keyword Type bigint def ideal int intmat intvec link list map matrix module number package poly proc qring resolution ring string vector pyobject |
---|
83 | |
---|
84 | |
---|
85 | syn match Error "\*/" |
---|
86 | " For wrong comments |
---|
87 | |
---|
88 | let b:current_syntax = "singular" |
---|