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
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
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