" Vim syntax file for the mpd programming language (version 1.0.1). " " Language: mpd " Maintainer: Matthias Schmidt " URL: http://www.mathematik.uni-marburg.de/~schmidtm/mpd.vim " Last Change: 2005 April 25 " Version: 0.2 " " Based on the syntax file for the D programming language by Jason Mills " " INSTALLATION: " " 0. Find your vim installation directory and set to $VIM " # setenv VIM /usr/local/share/vim/vim63/ " 1. Copy this file into the syntax/ subfolder of your vim installation " # cp mpd.vim $VIM/syntax " 2. Edit your filetype.vim file and add an entry for mpd " # vim $VIM/filetype.vim " au BufNewFile,BufRead *.mpd setf mpd " Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif " Keyword definitions " syn keyword mpdType bool int char real double string file syn keyword mpdUserTypes enum rec union ptr cap type const syn keyword mpdBoolean true false syn keyword mpdConstant null syn keyword mpdProcs proc procedure process returns type syn keyword mpdRessource resource import extend body final end separate syn keyword mpdGlobals global body end resource import final separate syn keyword mpdOperations op returns sem external optype syn keyword mpdQuantifier to by st downto syn keyword mpdSeqStatement skip stop if else exit next begin while for syn keyword mpdInteraction call send fork forward receive in ni st by V P syn keyword mpdInteraction return else reply create destroy on co oc vm syn keyword mpdFileDesc stderr stdin stdout syn keyword mpdRest and or any high low mod new noop ref res val xor " Comments " syn keyword mpdCommentTodo contained TODO FIXME TEMP XXX "syn region mpdCommentBlock start="/\*" end="\*/" contains=mpdCommentRaute,mpdCommentTodo syn region mpdCommentNested start="/\*" end="\*/" contains=mpdCommentNested,mpdCommentRaute,mpdCommentTodo syn match mpdCommentRaute +#.*+ contains=mpdCommentTodo,mpdCommentNested,mpdCommentRaute syn sync minlines=25 " Characters " syn match mpdSpecialCharError contained "[^']" " Escape sequences (oct,specal char,hex,wchar). These are not contained " because they are considered string litterals syn match mpdEscSequence "\\\(\o\{1,3}\|[\"\\'\\?ntbrfva]\|u\x\{4}\|U\x\{8}\|x\x\x\)" syn match mpdCharacter "'[^']*'" contains=mpdEscSequence,mpdSpecialCharError syn match mpdCharacter "'\\''" contains=mpdEscSequence syn match mpdCharacter "'[^\\]'" syn match mpdParTrenn "//" " String. " syn region mpdString start=+"+ end=+"+ contains=mpdEscSequence,@Spell syn region mpdRawString start=+`+ skip=+\\`+ end=+`+ contains=@Spell syn region mpdRawString start=+r"+ skip=+\\"+ end=+"+ contains=@Spell syn region mpdHexString start=+x"+ skip=+\\"+ end=+"+ " Numbers " syn case ignore syn match mpdInt display "\<\d[0-9_]*\(u\=l\=\|l\=u\=\)\>" syn match mpdHex display "\<0x[0-9a-f_]\+\(u\=l\=\|l\=u\=\)\>" syn match mpdHex display "\<\x[0-9a-f_]*h\(u\=l\=\|l\=u\=\)\>" syn match mpdOctal display "\<0[0-7_]\+\(u\=l\=\|l\=u\=\)\>" contains=cOctalZero syn match mpdOctalZero display contained "\<0" syn match mpdFloat display "\<\d[0-9_]*\(fi\=\|l\=i\)\>" syn match mpdFloat display "\<\d[0-9_]*\.[0-9_]*\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=" syn match mpdFloat display "\(\.[0-9_]\+\)\(e[-+]\=[0-9_]\+\)\=[fl]\=i\=\>" syn match mpdFloat display "\<\d[0-9_]*e[-+]\=[0-9_]\+[fl]\=\>" syn match mpdHexFloat display "\<0x\x\+\(fi\=\|l\=i\)\>" syn match mpdHexFloat display "\<0x\x\+\.\x*\(p[-+]\=\x\+\)\=[fl]\=i\=" syn match mpdHexFloat display "\<0x\x\+p[-+]\=\x\+[fl]\=\>" " binary numbers syn match mpdBinary display "\<0b[01_]\+\>" syn match mpdOctalError display "0\o*[89]\d*" syn case match " Use :let mpd_space_errors=1 to highlight unwanted spaces if exists("mpd_space_errors") syn match mpdSpaceError "\s\+$" endif " The default highlighting. " hi def link mpdSpaceError Error hi def link mpdBinary Number hi def link mpdInt Number hi def link mpdHex Number hi def link mpdOctal Number hi def link mpdFloat Float hi def link mpdHexFloat Float hi def link mpdBoolean Boolean hi def link mpdConstant Constant hi def link mpdFileDesc Constant hi def link mpdType Type hi def link mpdUserTypes Type hi def link mpdProcs Function hi def link mpdRessource StorageClass hi def link mpdGlobals StorageClass hi def link mpdOperations Operator hi def link mpdQuantifier Conditional hi def link mpdSeqStatement Conditional hi def link mpdInteraction Statement hi def link mpdRest Operator hi def link mpdParTrenn Operator hi def link mpdRawString String hi def link mpdString String hi def link mpdHexString String hi def link mpdCharacter Character hi def link mpdEscSequence SpecialChar hi def link mpdSpecialCharError Error hi def link mpdOctalError Error hi def link mpdOpOverload Operator hi def link mpdConstant Constant hi def link mpdCommentTodo Todo hi def link mpdCommentRaute Comment hi def link mpdCommentBlock Comment hi def link mpdCommentNested Comment let b:current_syntax = "mpd" " vim: ts=8