Add vim syntax highlighting definition
authorJeremy Kerr <jk@ozlabs.org>
Sun, 19 Nov 2006 12:22:18 +0000 (23:22 +1100)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 12 Nov 2009 23:58:41 +0000 (10:58 +1100)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
bitfield.vim [new file with mode: 0644]

diff --git a/bitfield.vim b/bitfield.vim
new file mode 100644 (file)
index 0000000..462b9f1
--- /dev/null
@@ -0,0 +1,41 @@
+" Vim syntax file
+"   Jeremy Kerr <jk@ozlabs.org>, 2005
+
+
+" Setup
+if version < 600
+       syntax clear
+"elseif exists("b:current_syntax")
+"      finish
+endif
+
+syn match bitfComment  /;.*$/
+
+syn match regID                /\[\S\+\]/
+syn match regParam     /^\(name\|width\)/
+
+syn match fieldName    /.*/                    contained
+syn match fieldRange   /\d\(\d\|[,\:]\)*/      contained nextgroup=fieldName
+syn region fieldDef    start=/^field:/ end=/$/ contains=fieldRange keepend
+
+syn match valueName    /.*/                    contained
+syn match valueNo      /\d\+/                  contained nextgroup=valueName
+syn region valueDef    start=/^value:/ end=/$/ contains=valueNo keepend
+
+if !exists("did_bitfield_syntax_inits")
+let did_bitfield_syntax_inits = 1
+hi link bitfComment    Comment
+
+hi link regID          Type
+hi link regParam       Keyword
+
+hi link fieldDef       Keyword
+hi link fieldRange     Number
+"hi link fieldName     Identifier
+
+hi link valueDef       Keyword
+hi link valueNo                Number
+hi link valueName      Identifier
+endif
+
+let b:current_syntax = "bitfield"