Mercurial > vim
annotate runtime/syntax/spice.vim @ 14108:a8d728a64b3d
Added tag v8.1.0071 for changeset 274c9f1fbfd2af52ed350b25f8bfc7b995cc5792
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 17 Jun 2018 21:45:06 +0200 |
parents | 46763b01cd9a |
children |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Spice circuit simulator input netlist | |
3 " Maintainer: Noam Halevy <Noam.Halevy.motorola.com> | |
3557 | 4 " Last Change: 2012 Jun 01 |
5 " (Dominique Pelle added @Spell) | |
7 | 6 " |
7 " This is based on sh.vim by Lennart Schultz | |
8 " but greatly simplified | |
9 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
10 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
11 if exists("b:current_syntax") |
7 | 12 finish |
13 endif | |
14 | |
15 " spice syntax is case INsensitive | |
16 syn case ignore | |
17 | |
18 syn keyword spiceTodo contained TODO | |
19 | |
3557 | 20 syn match spiceComment "^ \=\*.*$" contains=@Spell |
21 syn match spiceComment "\$.*$" contains=@Spell | |
7 | 22 |
23 " Numbers, all with engineering suffixes and optional units | |
24 "========================================================== | |
25 "floating point number, with dot, optional exponent | |
26 syn match spiceNumber "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\=" | |
27 "floating point number, starting with a dot, optional exponent | |
28 syn match spiceNumber "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\=" | |
29 "integer number with optional exponent | |
30 syn match spiceNumber "\<[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\=" | |
31 | |
32 " Misc | |
33 "===== | |
34 syn match spiceWrapLineOperator "\\$" | |
35 syn match spiceWrapLineOperator "^+" | |
36 | |
37 syn match spiceStatement "^ \=\.\I\+" | |
38 | |
39 " Matching pairs of parentheses | |
40 "========================================== | |
41 syn region spiceParen transparent matchgroup=spiceOperator start="(" end=")" contains=ALLBUT,spiceParenError | |
42 syn region spiceSinglequote matchgroup=spiceOperator start=+'+ end=+'+ | |
43 | |
44 " Errors | |
45 "======= | |
46 syn match spiceParenError ")" | |
47 | |
48 " Syncs | |
49 " ===== | |
50 syn sync minlines=50 | |
51 | |
52 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3557
diff
changeset
|
53 " Only when an item doesn't have highlighting yet |
7 | 54 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
55 hi def link spiceTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
56 hi def link spiceWrapLineOperator spiceOperator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
57 hi def link spiceSinglequote spiceExpr |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
58 hi def link spiceExpr Function |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
59 hi def link spiceParenError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
60 hi def link spiceStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
61 hi def link spiceNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
62 hi def link spiceComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
63 hi def link spiceOperator Operator |
7 | 64 |
65 | |
66 let b:current_syntax = "spice" | |
67 | |
68 " insert the following to $VIM/syntax/scripts.vim | |
69 " to autodetect HSpice netlists and text listing output: | |
70 " | |
71 " " Spice netlists and text listings | |
72 " elseif getline(1) =~ 'spice\>' || getline("$") =~ '^\.end' | |
73 " so <sfile>:p:h/spice.vim | |
74 | |
75 " vim: ts=8 |