annotate runtime/syntax/spice.vim @ 32767:c79fc3d7410c

Add syntax & ftplugin for pymanifest (#12773) Commit: https://github.com/vim/vim/commit/2f339aad6c80e82d7c1237b402392065857174d4 Author: ObserverOfTime <chronobserver@disroot.org> Date: Sun Aug 13 11:26:20 2023 +0300 Add syntax & ftplugin for pymanifest (https://github.com/vim/vim/issues/12773)
author Christian Brabandt <cb@256bit.org>
date Sun, 13 Aug 2023 10:30:09 +0200
parents 46763b01cd9a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Spice circuit simulator input netlist
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Noam Halevy <Noam.Halevy.motorola.com>
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
4 " Last Change: 2012 Jun 01
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
5 " (Dominique Pelle added @Spell)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " This is based on sh.vim by Lennart Schultz
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " but greatly simplified
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " spice syntax is case INsensitive
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn keyword spiceTodo contained TODO
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3557
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
20 syn match spiceComment "^ \=\*.*$" contains=@Spell
9cb3a75a20b9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
21 syn match spiceComment "\$.*$" contains=@Spell
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " Numbers, all with engineering suffixes and optional units
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 "==========================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 "floating point number, with dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match spiceNumber "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 "floating point number, starting with a dot, optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match spiceNumber "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 "integer number with optional exponent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match spiceNumber "\<[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " Misc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 "=====
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match spiceWrapLineOperator "\\$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match spiceWrapLineOperator "^+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match spiceStatement "^ \=\.\I\+"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Matching pairs of parentheses
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 "==========================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn region spiceParen transparent matchgroup=spiceOperator start="(" end=")" contains=ALLBUT,spiceParenError
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn region spiceSinglequote matchgroup=spiceOperator start=+'+ end=+'+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Errors
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 "=======
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match spiceParenError ")"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Syncs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 " =====
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn sync minlines=50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 let b:current_syntax = "spice"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 " insert the following to $VIM/syntax/scripts.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 " to autodetect HSpice netlists and text listing output:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " " Spice netlists and text listings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " elseif getline(1) =~ 'spice\>' || getline("$") =~ '^\.end'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " so <sfile>:p:h/spice.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " vim: ts=8