On 03.10.2012 21:33, Bram Moolenaar wrote: > > Daniel Mack wrote: > >> 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 :) > > The filetype detection looks good. > > For the syntax file, please add a header like in the other syntax file. > You can email the file to me. > >
Ok, new patch version attached. 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 Thu Oct 04 01:25:07 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 Thu Oct 04 01:25:07 2012 +0200 @@ -0,0 +1,26 @@ +" Vim syntax file +" Language: dts/dtsi (device tree files) +" Maintainer: Daniel Mack <[email protected]> +" Last Change: 2012 Oct 4 + +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
