source: git/Singular/LIB/singular.vim @ 91c7251

spielwiese
Last change on this file since 91c7251 was 025d9a, checked in by Hans Schoenemann <hannes@…>, 12 years ago
add: vim support for LIB files
  • Property mode set to 100644
File size: 4.1 KB
Line 
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
18if exists("b:current_syntax")
19  finish
20endif
21
22syn sync fromstart
23"start highlighting from the start of the document
24
25"COMMENT
26syn region      Comment        start="//" end="$"
27" stuff behind a // up to the newline
28syn region      Comment        start="/\*" end="\*/"
29" stuff between /* and */  including newlines
30
31" CONSTANTS
32" Strings
33syn region      String         start=+"+ end=+"+ contains=infostring
34" infostring are special keywords in the library
35syn keyword     infostring     AUTHORS OVERVIEW REFERENCES KEYWORDS SEE\ ALSO PROCEDURES USAGE RETURN NOTE ASSUME EXAMPLE LIBRARY contained=String
36"contained=String
37hi  link        infostring     SpecialComment
38" Highlight infostring as if it is a special comment
39" Library specific stuff
40syn keyword     Label          version category info
41"Numbers
42syn match       Number         "\d\+"
43"Floats
44syn match       Float          "[+-]\?\d\+\.\d*" " stuff like -12.05
45syn 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
49syn keyword     Function        attrib
50syn keyword     Function        bareiss betti
51syn keyword     Function        char char_series charstr chinrem cleardenom close coef coeffs contract
52syn keyword     Function        datetime dbprint defined deg degree delete det diff dim division dump
53syn keyword     Function        eliminate eval ERROR example execute extgcd
54syn keyword     Function        facstd factmodd factorize farey fetch fglm fglmquot find finduni fprintf freemodule frwalk
55syn keyword     Function        gcd gen getdump groebner
56syn keyword     Function        help highcorner hilb homog hres
57syn keyword     Function        imap impart indepSet insert interpolation interred intersect
58syn keyword     Function        jacob janet jet
59syn keyword     Function        kbase kernel kill killattrib koszul
60syn keyword     Function        laguerre lead leadcoef leadexp leadmonom LIB lift liftstd listvar lres ludecomp luinverse lusolve
61syn keyword     Function        maxideal memory minbase minor minres modulo monitor monomial mpresmat mres mstd mult
62syn keyword     Function        nameof names ncols npars nres nrows nvars
63syn keyword     Function        open option ord ordstr
64syn keyword     Function        par pardeg parstr preimage prime primefactors print printf prune
65syn keyword     Function        qhweight qrds quote quotient
66syn keyword     Function        random rank read reduce regularity repart res reservedName resultant ringlist rvar
67syn keyword     Function        setring simplex simplify size slimgb sortvec sqrfree sprintf sres status std stdfglm stdhilb subst system syz
68syn keyword     Function        trace transpose type typeof
69syn keyword     Function        univariate uressolve
70syn keyword     Function        vandermonde var variables varstr vdim
71syn keyword     Function        waitall waitfirst wedge weight weightKB write
72
73" STATEMENT
74" Conditional
75syn keyword     Conditional    if else
76" Repeat
77syn keyword     Repeat         for while
78"Keyword, also known as stuff that fits nowhere else (within statements)
79syn keyword     Keyword        break breakpoint continue export exportto importfrom keepring load quit return ~ 
80
81" TYPE
82syn 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
85syn match       Error          "\*/"
86" For wrong comments
87
88let b:current_syntax = "singular"
Note: See TracBrowser for help on using the repository browser.