neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

mush.vim (13187B)


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