mush.vim 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. " MUSHcode syntax file
  2. " Maintainer: Rick Bird <nveid@nveid.com>
  3. " Based on vim Syntax file by: Bek Oberin <gossamer@tertius.net.au>
  4. " Last Updated: Fri Nov 04 20:28:15 2005
  5. "
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. " regular mush functions
  11. syntax keyword mushFunction contained @@ abs accent accname acos add after align
  12. syntax keyword mushFunction contained allof alphamax alphamin and andflags
  13. syntax keyword mushFunction contained andlflags andlpowers andpowers ansi aposs art
  14. syntax keyword mushFunction contained asin atan atan2 atrlock attrcnt band baseconv
  15. syntax keyword mushFunction contained beep before blank2tilde bnand bnot bor bound
  16. syntax keyword mushFunction contained brackets break bxor cand cansee capstr case
  17. syntax keyword mushFunction contained caseall cat ceil center checkpass children
  18. syntax keyword mushFunction contained chr clone cmds cnetpost comp con config conn
  19. syntax keyword mushFunction contained controls convsecs convtime convutcsecs cor
  20. syntax keyword mushFunction contained cos create ctime ctu dec decrypt default
  21. syntax keyword mushFunction contained delete die dig digest dist2d dist3d div
  22. syntax keyword mushFunction contained division divscope doing downdiv dynhelp e
  23. syntax keyword mushFunction contained edefault edit element elements elist elock
  24. syntax keyword mushFunction contained emit empire empower encrypt endtag entrances
  25. syntax keyword mushFunction contained eq escape etimefmt eval exit exp extract fdiv
  26. syntax keyword mushFunction contained filter filterbool findable first firstof
  27. syntax keyword mushFunction contained flags flip floor floordiv fmod fold
  28. syntax keyword mushFunction contained folderstats followers following foreach
  29. syntax keyword mushFunction contained fraction fullname functions get get_eval grab
  30. syntax keyword mushFunction contained graball grep grepi gt gte hasattr hasattrp
  31. syntax keyword mushFunction contained hasattrpval hasattrval hasdivpower hasflag
  32. syntax keyword mushFunction contained haspower haspowergroup hastype height hidden
  33. syntax keyword mushFunction contained home host hostname html idle idlesecs
  34. syntax keyword mushFunction contained idle_average idle_times idle_total if ifelse
  35. syntax keyword mushFunction contained ilev iname inc index indiv indivall insert
  36. syntax keyword mushFunction contained inum ipaddr isdaylight isdbref isint isnum
  37. syntax keyword mushFunction contained isword itemize items iter itext last lattr
  38. syntax keyword mushFunction contained lcon lcstr ldelete ldivisions left lemit
  39. syntax keyword mushFunction contained level lexits lflags link list lit ljust lmath
  40. syntax keyword mushFunction contained ln lnum loc localize locate lock loctree log
  41. syntax keyword mushFunction contained lparent lplayers lports lpos lsearch lsearchr
  42. syntax keyword mushFunction contained lstats lt lte lthings lvcon lvexits lvplayers
  43. syntax keyword mushFunction contained lvthings lwho mail maildstats mailfrom
  44. syntax keyword mushFunction contained mailfstats mailstats mailstatus mailsubject
  45. syntax keyword mushFunction contained mailtime map match matchall max mean median
  46. syntax keyword mushFunction contained member merge mid min mix mod modulo modulus
  47. syntax keyword mushFunction contained money mtime mudname mul munge mwho name nand
  48. syntax keyword mushFunction contained nattr ncon nearby neq nexits next nor not
  49. syntax keyword mushFunction contained nplayers nsemit nslemit nsoemit nspemit
  50. syntax keyword mushFunction contained nsremit nszemit nthings null num nvcon
  51. syntax keyword mushFunction contained nvexits nvplayers nvthings obj objeval objid
  52. syntax keyword mushFunction contained objmem oemit ooref open or ord orflags
  53. syntax keyword mushFunction contained orlflags orlpowers orpowers owner parent
  54. syntax keyword mushFunction contained parse pcreate pemit pi pickrand playermem
  55. syntax keyword mushFunction contained pmatch poll ports pos poss power powergroups
  56. syntax keyword mushFunction contained powers powover program prompt pueblo quitprog
  57. syntax keyword mushFunction contained quota r rand randword recv regedit regeditall
  58. syntax keyword mushFunction contained regeditalli regediti regmatch regmatchi
  59. syntax keyword mushFunction contained regrab regraball regraballi regrabi regrep
  60. syntax keyword mushFunction contained regrepi remainder remit remove repeat replace
  61. syntax keyword mushFunction contained rest restarts restarttime reswitch
  62. syntax keyword mushFunction contained reswitchall reswitchalli reswitchi reverse
  63. syntax keyword mushFunction contained revwords right rjust rloc rnum room root
  64. syntax keyword mushFunction contained round s scan scramble search secs secure sent
  65. syntax keyword mushFunction contained set setdiff setinter setq setr setunion sha0
  66. syntax keyword mushFunction contained shl shr shuffle sign signal sin sort sortby
  67. syntax keyword mushFunction contained soundex soundlike soundslike space spellnum
  68. syntax keyword mushFunction contained splice sql sqlescape sqrt squish ssl
  69. syntax keyword mushFunction contained starttime stats stddev step strcat strinsert
  70. syntax keyword mushFunction contained stripaccents stripansi strlen strmatch
  71. syntax keyword mushFunction contained strreplace sub subj switch switchall t table
  72. syntax keyword mushFunction contained tag tagwrap tan tel terminfo textfile
  73. syntax keyword mushFunction contained tilde2blank time timefmt timestring tr
  74. syntax keyword mushFunction contained trigger trim trimpenn trimtiny trunc type u
  75. syntax keyword mushFunction contained ucstr udefault ufun uldefault ulocal updiv
  76. syntax keyword mushFunction contained utctime v vadd val valid vcross vdim vdot
  77. syntax keyword mushFunction contained version visible vmag vmax vmin vmul vsub
  78. syntax keyword mushFunction contained vtattr vtcount vtcreate vtdestroy vtlcon
  79. syntax keyword mushFunction contained vtloc vtlocate vtmaster vtname vtref vttel
  80. syntax keyword mushFunction contained vunit wait where width wipe wordpos words
  81. syntax keyword mushFunction contained wrap xcon xexits xget xor xplayers xthings
  82. syntax keyword mushFunction contained xvcon xvexits xvplayers xvthings zemit zfun
  83. syntax keyword mushFunction contained zmwho zone zwho
  84. " only highligh functions when they have an in-bracket immediately after
  85. syntax match mushFunctionBrackets "\i*(" contains=mushFunction
  86. "
  87. " regular mush commands
  88. syntax keyword mushAtCommandList contained @ALLHALT @ALLQUOTA @ASSERT @ATRCHOWN @ATRLOCK @ATTRIBUTE @BOOT
  89. syntax keyword mushAtCommandList contained @BREAK @CEMIT @CHANNEL @CHAT @CHOWN @CHOWNALL @CHZONE @CHZONEALL
  90. syntax keyword mushAtCommandList contained @CLOCK @CLONE @COBJ @COMMAND @CONFIG @CPATTR @CREATE @CRPLOG @DBCK
  91. syntax keyword mushAtCommandList contained @DECOMPILE @DESTROY @DIG @DISABLE @DIVISION @DOING @DOLIST @DRAIN
  92. syntax keyword mushAtCommandList contained @DUMP @EDIT @ELOCK @EMIT @EMPOWER @ENABLE @ENTRANCES @EUNLOCK @FIND
  93. syntax keyword mushAtCommandList contained @FIRSTEXIT @FLAG @FORCE @FUNCTION @EDIT @GREP @HALT @HIDE @HOOK @KICK
  94. syntax keyword mushAtCommandList contained @LEMIT @LEVEL @LINK @LIST @LISTMOTD @LOCK @LOG @LOGWIPE @LSET @MAIL @MALIAS
  95. syntax keyword mushAtCommandList contained @MAP @MOTD @MVATTR @NAME @NEWPASSWORD @NOTIFY @NSCEMIT @NSEMIT @NSLEMIT
  96. syntax keyword mushAtCommandList contained @NSOEMIT @NSPEMIT @NSPEMIT @NSREMIT @NSZEMIT @NUKE @OEMIT @OPEN @PARENT @PASSWORD
  97. syntax keyword mushAtCommandList contained @PCREATE @PEMIT @POLL @POOR @POWERLEVEL @PROGRAM @PROMPT @PS @PURGE @QUOTA
  98. syntax keyword mushAtCommandList contained @READCACHE @RECYCLE @REJECTMOTD @REMIT @RESTART @SCAN @SEARCH @SELECT @SET
  99. syntax keyword mushAtCommandList contained @SHUTDOWN @SITELOCK @SNOOP @SQL @SQUOTA @STATS @SWITCH @SWEEP @SWITCH @TELEPORT
  100. syntax keyword mushAtCommandList contained @TRIGGER @ULOCK @UNDESTROY @UNLINK @UNLOCK @UNRECYCLE @UPTIME @UUNLOCK @VERB
  101. syntax keyword mushAtCommandList contained @VERSION @WAIT @WALL @WARNINGS @WCHECK @WHEREIS @WIPE @ZCLONE @ZEMIT
  102. syntax match mushCommand "@\i\I*" contains=mushAtCommandList
  103. syntax keyword mushCommand AHELP ANEWS ATTRIB_SET BRIEF BRIEF BUY CHANGES DESERT
  104. syntax keyword mushCommand DISMISS DROP EMPTY ENTER EXAMINE FOLLOW GET GIVE GOTO
  105. syntax keyword mushCommand HELP HUH_COMMAND INVENTORY INVENTORY LOOK LEAVE LOOK
  106. syntax keyword mushCommand GOTO NEWS PAGE PAGE POSE RULES SAY SCORE SEMIPOSE
  107. syntax keyword mushCommand SPECIALNEWS TAKE TEACH THINK UNFOLLOW USE WHISPER WHISPER
  108. syntax keyword mushCommand WARN_ON_MISSING WHISPER WITH
  109. syntax match mushSpecial "\*\|!\|=\|-\|\\\|+"
  110. syntax match mushSpecial2 contained "\*"
  111. syn region mushString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=mushSpecial,mushSpecial2,@Spell
  112. syntax match mushIdentifier "&[^ ]\+"
  113. syntax match mushVariable "%r\|%t\|%cr\|%[A-Za-z0-9]\+\|%#\|##\|here"
  114. " numbers
  115. syntax match mushNumber +[0-9]\++
  116. " A comment line starts with a or # or " at the start of the line
  117. " or an @@
  118. syntax keyword mushTodo contained TODO FIXME XXX
  119. syntax cluster mushCommentGroup contains=mushTodo
  120. syntax match mushComment "^\s*@@.*$" contains=mushTodo
  121. syntax match mushComment "^#[^define|^ifdef|^else|^pragma|^ifndef|^echo|^elif|^undef|^warning].*$" contains=mushTodo
  122. syntax match mushComment "^#$" contains=mushTodo
  123. syntax region mushComment matchgroup=mushCommentStart start="/@@" end="@@/" contains=@mushCommentGroup,mushCommentStartError,mushCommentString,@Spell
  124. syntax region mushCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+@@/+me=s-1 contains=mushCommentSkip
  125. syntax match mushCommentSkip contained "^\s*@@\($\|\s\+\)"
  126. syntax match mushCommentStartError display "/@@"me=e-1 contained
  127. " syntax match mushComment +^".*$+ contains=mushTodo
  128. " Work on this one
  129. " syntax match mushComment +^#.*$+ contains=mushTodo
  130. syn region mushPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=mushComment
  131. syn match mushPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
  132. syn cluster mushPreProcGroup contains=mushPreCondit,mushIncluded,mushInclude,mushDefine,mushSpecial,mushString,mushCommentSkip,mushCommentString,@mushCommentGroup,mushCommentStartError
  133. syn region mushIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
  134. syn match mushIncluded display contained "<[^>]*>"
  135. syn match mushInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=mushIncluded
  136. syn region mushDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@mushPreProcGroup,@Spell
  137. syn region mushPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@mushPreProcGroup
  138. syntax region mushFuncBoundaries start="\[" end="\]" contains=mushFunction,mushFlag,mushAttributes,mushNumber,mushCommand,mushVariable,mushSpecial2
  139. " FLAGS
  140. syntax keyword mushFlag PLAYER ABODE BUILDER CHOWN_OK DARK FLOATING
  141. syntax keyword mushFlag GOING HAVEN INHERIT JUMP_OK KEY LINK_OK MONITOR
  142. syntax keyword mushFlag NOSPOOF OPAQUE QUIET STICKY TRACE UNFINDABLE VISUAL
  143. syntax keyword mushFlag WIZARD PARENT_OK ZONE AUDIBLE CONNECTED DESTROY_OK
  144. syntax keyword mushFlag ENTER_OK HALTED IMMORTAL LIGHT MYOPIC PUPPET TERSE
  145. syntax keyword mushFlag ROBOT SAFE TRANSPARENT VERBOSE CONTROL_OK COMMANDS
  146. syntax keyword mushAttribute aahear aclone aconnect adesc adfail adisconnect
  147. syntax keyword mushAttribute adrop aefail aenter afail agfail ahear akill
  148. syntax keyword mushAttribute aleave alfail alias amhear amove apay arfail
  149. syntax keyword mushAttribute asucc atfail atport aufail ause away charges
  150. syntax keyword mushAttribute cost desc dfail drop ealias efail enter fail
  151. syntax keyword mushAttribute filter forwardlist gfail idesc idle infilter
  152. syntax keyword mushAttribute inprefix kill lalias last lastsite leave lfail
  153. syntax keyword mushAttribute listen move odesc odfail odrop oefail oenter
  154. syntax keyword mushAttribute ofail ogfail okill oleave olfail omove opay
  155. syntax keyword mushAttribute orfail osucc otfail otport oufail ouse oxenter
  156. syntax keyword mushAttribute oxleave oxtport pay prefix reject rfail runout
  157. syntax keyword mushAttribute semaphore sex startup succ tfail tport ufail
  158. syntax keyword mushAttribute use va vb vc vd ve vf vg vh vi vj vk vl vm vn
  159. syntax keyword mushAttribute vo vp vq vr vs vt vu vv vw vx vy vz
  160. " The default methods for highlighting. Can be overridden later
  161. hi def link mushAttribute Constant
  162. hi def link mushCommand Function
  163. hi def link mushNumber Number
  164. hi def link mushSetting PreProc
  165. hi def link mushFunction Statement
  166. hi def link mushVariable Identifier
  167. hi def link mushSpecial Special
  168. hi def link mushTodo Todo
  169. hi def link mushFlag Special
  170. hi def link mushIdentifier Identifier
  171. hi def link mushDefine Macro
  172. hi def link mushPreProc PreProc
  173. hi def link mushPreProcGroup PreProc
  174. hi def link mushPreCondit PreCondit
  175. hi def link mushIncluded cString
  176. hi def link mushInclude Include
  177. " Comments
  178. hi def link mushCommentStart mushComment
  179. hi def link mushComment Comment
  180. hi def link mushCommentString mushString
  181. let b:current_syntax = "mush"
  182. " mush: ts=17