Message from discussion
add syntax file for dts/dtsi
Received: by 10.224.31.20 with SMTP id w20mr3882802qac.2.1349290139118;
Wed, 03 Oct 2012 11:48:59 -0700 (PDT)
X-BeenThere: vim_dev@googlegroups.com
Received: by 10.229.172.131 with SMTP id l3ls225730qcz.1.gmail; Wed, 03 Oct
2012 11:48:54 -0700 (PDT)
Received: by 10.224.189.75 with SMTP id dd11mr3886901qab.6.1349290134424;
Wed, 03 Oct 2012 11:48:54 -0700 (PDT)
Received: by 10.224.28.72 with SMTP id l8msqac;
Wed, 3 Oct 2012 10:34:31 -0700 (PDT)
Received: by 10.236.183.101 with SMTP id p65mr331343yhm.20.1349285671371;
Wed, 03 Oct 2012 10:34:31 -0700 (PDT)
Date: Wed, 3 Oct 2012 10:34:28 -0700 (PDT)
From: Daniel Mack <zon...@gmail.com>
To: vim_dev@googlegroups.com
Message-Id: <96a400dc-ee15-49f4-b3ba-f53d01552b4a@googlegroups.com>
Subject: [PATCH] add syntax file for dts/dtsi
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1917_15178426.1349285668362"
------=_Part_1917_15178426.1349285668362
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
This patch adds support for dts/dtsi (device-tree) files.
Please let me know if that is an appropriate form of submission - I never contributed to vim before :)
Thanks,
Daniel
------=_Part_1917_15178426.1349285668362
Content-Type: text/x-diff; charset=US-ASCII; name=dts.diff
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=dts.diff
X-Attachment-Id: 517db453-6479-4be5-9bc7-40a283b13dc2
diff -r ec35376769a7 runtime/filetype.vim
--- a/runtime/filetype.vim Wed Oct 03 18:50:00 2012 +0200
+++ b/runtime/filetype.vim Wed Oct 03 19:31:23 2012 +0200
@@ -633,6 +633,9 @@
" DTD (Document Type Definition for XML)
au BufNewFile,BufRead *.dtd setf dtd
+" DTS/DSTI (device tree files)
+au BufNewFile,BufRead *.dts,*.dtsi setf dts
+
" EDIF (*.edf,*.edif,*.edn,*.edo)
au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
diff -r ec35376769a7 runtime/syntax/dts.vim
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/runtime/syntax/dts.vim Wed Oct 03 19:31:23 2012 +0200
@@ -0,0 +1,21 @@
+if exists("b:current_syntax")
+ finish
+endif
+
+syntax region dtsComment start="/\*" end="\*/"
+syntax match dtsReference "&[[:alpha:][:digit:]_]\+"
+syntax region dtsBinaryProperty start="\[" end="\]"
+syntax match dtsStringProperty "\".*\""
+syntax match dtsKeyword "/.*/"
+syntax match dtsLabel "^[[:space:]]*[[:alpha:][:digit:]_]\+:"
+syntax region dtsCellProperty start="<" end=">" contains=dtsReference,dtsBinaryProperty,dtsStringProperty,dtsComment
+syntax region dtsCommentInner start="/\*" end="\*/"
+
+hi def link dtsCellProperty Number
+hi def link dtsBinaryProperty Number
+hi def link dtsStringProperty String
+hi def link dtsKeyword Include
+hi def link dtsLabel Label
+hi def link dtsReference Macro
+hi def link dtsComment Comment
+hi def link dtsCommentInner Comment
------=_Part_1917_15178426.1349285668362--