Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2 | " Language: Quake[1-3] configuration file |
| 3 | " Previous Maintainer: Nikolai Weibull <now@bitwi.se> |
| 4 | " Latest Revision: 2007-06-17 |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 5 | " quake_is_quake1 - the syntax is to be used for quake1 configs |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 6 | " quake_is_quake2 - the syntax is to be used for quake2 configs |
| 7 | " quake_is_quake3 - the syntax is to be used for quake3 configs |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 8 | " Credits: Tomasz Kalkosinski wrote the original quake3Colors stuff |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 10 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 11 | finish |
| 12 | endif |
| 13 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 14 | let s:cpo_save = &cpo |
| 15 | set cpo&vim |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 16 | |
Bram Moolenaar | 8c8de83 | 2008-06-24 22:58:06 +0000 | [diff] [blame] | 17 | setlocal iskeyword+=-,+ |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 18 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 19 | syn keyword quakeTodo contained TODO FIXME XXX NOTE |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 20 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 21 | syn region quakeComment display oneline start='//' end='$' end=';' |
| 22 | \ keepend contains=quakeTodo,@Spell |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 23 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 24 | syn region quakeString display oneline start=+"+ skip=+\\\\\|\\"+ |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 25 | \ end=+"\|$+ contains=quakeNumbers, |
| 26 | \ @quakeCommands,@quake3Colors |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 27 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 28 | syn case ignore |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 29 | |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 30 | syn match quakeNumbers display transparent '\<-\=\d\|\.\d' |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 31 | \ contains=quakeNumber,quakeFloat, |
| 32 | \ quakeOctalError,quakeOctal |
| 33 | syn match quakeNumber contained display '\d\+\>' |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 34 | syn match quakeFloat contained display '\d\+\.\d*' |
| 35 | syn match quakeFloat contained display '\.\d\+\>' |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 36 | |
| 37 | if exists("quake_is_quake1") || exists("quake_is_quake2") |
| 38 | syn match quakeOctal contained display '0\o\+\>' |
| 39 | \ contains=quakeOctalZero |
| 40 | syn match quakeOctalZero contained display '\<0' |
| 41 | syn match quakeOctalError contained display '0\o*[89]\d*' |
| 42 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 43 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 44 | syn cluster quakeCommands contains=quakeCommand,quake1Command, |
| 45 | \ quake12Command,Quake2Command,Quake23Command, |
| 46 | \ Quake3Command |
| 47 | |
| 48 | syn keyword quakeCommand +attack +back +forward +left +lookdown +lookup |
| 49 | syn keyword quakeCommand +mlook +movedown +moveleft +moveright +moveup |
| 50 | syn keyword quakeCommand +right +speed +strafe -attack -back bind |
| 51 | syn keyword quakeCommand bindlist centerview clear connect cvarlist dir |
| 52 | syn keyword quakeCommand disconnect dumpuser echo error exec -forward |
| 53 | syn keyword quakeCommand god heartbeat joy_advancedupdate kick kill |
| 54 | syn keyword quakeCommand killserver -left -lookdown -lookup map |
| 55 | syn keyword quakeCommand messagemode messagemode2 -mlook modellist |
| 56 | syn keyword quakeCommand -movedown -moveleft -moveright -moveup play |
| 57 | syn keyword quakeCommand quit rcon reconnect record -right say say_team |
| 58 | syn keyword quakeCommand screenshot serverinfo serverrecord serverstop |
| 59 | syn keyword quakeCommand set sizedown sizeup snd_restart soundinfo |
| 60 | syn keyword quakeCommand soundlist -speed spmap status -strafe stopsound |
| 61 | syn keyword quakeCommand toggleconsole unbind unbindall userinfo pause |
| 62 | syn keyword quakeCommand vid_restart viewpos wait weapnext weapprev |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 63 | |
| 64 | if exists("quake_is_quake1") |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 65 | syn keyword quake1Command sv |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 66 | endif |
| 67 | |
| 68 | if exists("quake_is_quake1") || exists("quake_is_quake2") |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 69 | syn keyword quake12Command +klook alias cd impulse link load save |
| 70 | syn keyword quake12Command timerefresh changing info loading |
| 71 | syn keyword quake12Command pingservers playerlist players score |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 72 | endif |
| 73 | |
| 74 | if exists("quake_is_quake2") |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 75 | syn keyword quake2Command cmd demomap +use condump download drop gamemap |
| 76 | syn keyword quake2Command give gun_model setmaster sky sv_maplist wave |
| 77 | syn keyword quake2Command cmdlist gameversiona gun_next gun_prev invdrop |
| 78 | syn keyword quake2Command inven invnext invnextp invnextw invprev |
| 79 | syn keyword quake2Command invprevp invprevw invuse menu_addressbook |
| 80 | syn keyword quake2Command menu_credits menu_dmoptions menu_game |
| 81 | syn keyword quake2Command menu_joinserver menu_keys menu_loadgame |
| 82 | syn keyword quake2Command menu_main menu_multiplayer menu_options |
| 83 | syn keyword quake2Command menu_playerconfig menu_quit menu_savegame |
| 84 | syn keyword quake2Command menu_startserver menu_video |
| 85 | syn keyword quake2Command notarget precache prog togglechat vid_front |
| 86 | syn keyword quake2Command weaplast |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 87 | endif |
| 88 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 89 | if exists("quake_is_quake2") || exists("quake_is_quake3") |
| 90 | syn keyword quake23Command imagelist modellist path z_stats |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 91 | endif |
| 92 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 93 | if exists("quake_is_quake3") |
| 94 | syn keyword quake3Command +info +scores +zoom addbot arena banClient |
| 95 | syn keyword quake3Command banUser callteamvote callvote changeVectors |
| 96 | syn keyword quake3Command cinematic clientinfo clientkick cmd cmdlist |
| 97 | syn keyword quake3Command condump configstrings crash cvar_restart devmap |
| 98 | syn keyword quake3Command fdir follow freeze fs_openedList Fs_pureList |
| 99 | syn keyword quake3Command Fs_referencedList gfxinfo globalservers |
| 100 | syn keyword quake3Command hunk_stats in_restart -info levelshot |
| 101 | syn keyword quake3Command loaddeferred localservers map_restart mem_info |
| 102 | syn keyword quake3Command messagemode3 messagemode4 midiinfo model music |
| 103 | syn keyword quake3Command modelist net_restart nextframe nextskin noclip |
| 104 | syn keyword quake3Command notarget ping prevframe prevskin reset restart |
| 105 | syn keyword quake3Command s_disable_a3d s_enable_a3d s_info s_list s_stop |
| 106 | syn keyword quake3Command scanservers -scores screenshotJPEG sectorlist |
| 107 | syn keyword quake3Command serverstatus seta setenv sets setu setviewpos |
| 108 | syn keyword quake3Command shaderlist showip skinlist spdevmap startOribt |
| 109 | syn keyword quake3Command stats stopdemo stoprecord systeminfo togglemenu |
| 110 | syn keyword quake3Command tcmd team teamtask teamvote tell tell_attacker |
| 111 | syn keyword quake3Command tell_target testgun testmodel testshader toggle |
| 112 | syn keyword quake3Command touchFile vminfo vmprofile vmtest vosay |
| 113 | syn keyword quake3Command vosay_team vote votell vsay vsay_team vstr |
| 114 | syn keyword quake3Command vtaunt vtell vtell_attacker vtell_target weapon |
| 115 | syn keyword quake3Command writeconfig -zoom |
| 116 | syn match quake3Command display "\<[+-]button\(\d\|1[0-4]\)\>" |
| 117 | endif |
| 118 | |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 119 | if exists("quake_is_quake3") |
| 120 | syn cluster quake3Colors contains=quake3Red,quake3Green,quake3Yellow, |
| 121 | \ quake3Blue,quake3Cyan,quake3Purple,quake3White, |
| 122 | \ quake3Orange,quake3Grey,quake3Black,quake3Shadow |
| 123 | |
| 124 | syn region quake3Red contained start=+\^1+hs=e+1 end=+[$^"\n]+he=e-1 |
| 125 | syn region quake3Green contained start=+\^2+hs=e+1 end=+[$^"\n]+he=e-1 |
| 126 | syn region quake3Yellow contained start=+\^3+hs=e+1 end=+[$^"\n]+he=e-1 |
| 127 | syn region quake3Blue contained start=+\^4+hs=e+1 end=+[$^"\n]+he=e-1 |
| 128 | syn region quake3Cyan contained start=+\^5+hs=e+1 end=+[$^"\n]+he=e-1 |
| 129 | syn region quake3Purple contained start=+\^6+hs=e+1 end=+[$^"\n]+he=e-1 |
| 130 | syn region quake3White contained start=+\^7+hs=e+1 end=+[$^"\n]+he=e-1 |
| 131 | syn region quake3Orange contained start=+\^8+hs=e+1 end=+[$^\"\n]+he=e-1 |
| 132 | syn region quake3Grey contained start=+\^9+hs=e+1 end=+[$^"\n]+he=e-1 |
| 133 | syn region quake3Black contained start=+\^0+hs=e+1 end=+[$^"\n]+he=e-1 |
| 134 | syn region quake3Shadow contained start=+\^[Xx]+hs=e+1 end=+[$^"\n]+he=e-1 |
| 135 | endif |
| 136 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 137 | hi def link quakeComment Comment |
| 138 | hi def link quakeTodo Todo |
| 139 | hi def link quakeString String |
| 140 | hi def link quakeNumber Number |
| 141 | hi def link quakeOctal Number |
| 142 | hi def link quakeOctalZero PreProc |
| 143 | hi def link quakeFloat Number |
| 144 | hi def link quakeOctalError Error |
| 145 | hi def link quakeCommand quakeCommands |
| 146 | hi def link quake1Command quakeCommands |
| 147 | hi def link quake12Command quakeCommands |
| 148 | hi def link quake2Command quakeCommands |
| 149 | hi def link quake23Command quakeCommands |
| 150 | hi def link quake3Command quakeCommands |
| 151 | hi def link quakeCommands Keyword |
| 152 | |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 153 | if exists("quake_is_quake3") |
| 154 | hi quake3Red ctermfg=Red guifg=Red |
| 155 | hi quake3Green ctermfg=Green guifg=Green |
| 156 | hi quake3Yellow ctermfg=Yellow guifg=Yellow |
| 157 | hi quake3Blue ctermfg=Blue guifg=Blue |
| 158 | hi quake3Cyan ctermfg=Cyan guifg=Cyan |
| 159 | hi quake3Purple ctermfg=DarkMagenta guifg=Purple |
| 160 | hi quake3White ctermfg=White guifg=White |
| 161 | hi quake3Black ctermfg=Black guifg=Black |
| 162 | hi quake3Orange ctermfg=Brown guifg=Orange |
| 163 | hi quake3Grey ctermfg=LightGrey guifg=LightGrey |
| 164 | hi quake3Shadow cterm=underline gui=underline |
| 165 | endif |
| 166 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 167 | let b:current_syntax = "quake" |
| 168 | |
| 169 | let &cpo = s:cpo_save |
| 170 | unlet s:cpo_save |