blob: b86d52804cddd5bd21db767684217dd019acd787 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaar42eeac32005-06-29 22:40:58 +00002" Language: Quake[1-3] configuration file
3" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
4" Latest Revision: 2005-06-29
5" quake_is_quake2 - the syntax is to be used for quake2 configs
6" quake_is_quake3 - the syntax is to be used for quake3 configs
Bram Moolenaar071d4272004-06-13 20:20:40 +00007
Bram Moolenaar42eeac32005-06-29 22:40:58 +00008if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00009 finish
10endif
11
Bram Moolenaar42eeac32005-06-29 22:40:58 +000012let s:cpo_save = &cpo
13set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000014
Bram Moolenaar42eeac32005-06-29 22:40:58 +000015setlocal iskeyword=@,48-57,+,-,_
Bram Moolenaar071d4272004-06-13 20:20:40 +000016
Bram Moolenaar42eeac32005-06-29 22:40:58 +000017syn keyword quakeTodo contained TODO FIXME XXX NOTE
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
Bram Moolenaar42eeac32005-06-29 22:40:58 +000019syn region quakeComment display oneline start='//' end='$' end=';'
20 \ keepend contains=quakeTodo,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000021
Bram Moolenaar42eeac32005-06-29 22:40:58 +000022syn region quakeString display oneline start=+"+ skip=+\\\\\|\\"+
23 \ end=+"\|$+ contains=quakeNumbers,@quakeCommands
Bram Moolenaar071d4272004-06-13 20:20:40 +000024
Bram Moolenaar071d4272004-06-13 20:20:40 +000025syn case ignore
Bram Moolenaar071d4272004-06-13 20:20:40 +000026
Bram Moolenaar42eeac32005-06-29 22:40:58 +000027syn match quakeNumbers display transparent '\<\d\|\.\d'
28 \ contains=quakeNumber,quakeFloat,
29 \ quakeOctalError,quakeOctal
30syn match quakeNumber contained display '\d\+\>'
31syn match quakeOctal contained display '0\o\+\>'
32 \ contains=quakeOctalZero
33syn match quakeOctalZero contained display '\<0'
34syn match quakeFloat contained display '\d\+\.\d*'
35syn match quakeFloat contained display '\.\d\+\>'
36syn match quakeOctalError contained display '0\o*[89]\d*'
Bram Moolenaar071d4272004-06-13 20:20:40 +000037
Bram Moolenaar42eeac32005-06-29 22:40:58 +000038syn cluster quakeCommands contains=quakeCommand,quake1Command,
39 \ quake12Command,Quake2Command,Quake23Command,
40 \ Quake3Command
41
42syn keyword quakeCommand +attack +back +forward +left +lookdown +lookup
43syn keyword quakeCommand +mlook +movedown +moveleft +moveright +moveup
44syn keyword quakeCommand +right +speed +strafe -attack -back bind
45syn keyword quakeCommand bindlist centerview clear connect cvarlist dir
46syn keyword quakeCommand disconnect dumpuser echo error exec -forward
47syn keyword quakeCommand god heartbeat joy_advancedupdate kick kill
48syn keyword quakeCommand killserver -left -lookdown -lookup map
49syn keyword quakeCommand messagemode messagemode2 -mlook modellist
50syn keyword quakeCommand -movedown -moveleft -moveright -moveup play
51syn keyword quakeCommand quit rcon reconnect record -right say say_team
52syn keyword quakeCommand screenshot serverinfo serverrecord serverstop
53syn keyword quakeCommand set sizedown sizeup snd_restart soundinfo
54syn keyword quakeCommand soundlist -speed spmap status -strafe stopsound
55syn keyword quakeCommand toggleconsole unbind unbindall userinfo pause
56syn keyword quakeCommand vid_restart viewpos wait weapnext weapprev
Bram Moolenaar071d4272004-06-13 20:20:40 +000057
58if exists("quake_is_quake1")
Bram Moolenaar42eeac32005-06-29 22:40:58 +000059 syn keyword quake1Command sv
Bram Moolenaar071d4272004-06-13 20:20:40 +000060endif
61
62if exists("quake_is_quake1") || exists("quake_is_quake2")
Bram Moolenaar42eeac32005-06-29 22:40:58 +000063 syn keyword quake12Command +klook alias cd impulse link load save
64 syn keyword quake12Command timerefresh changing info loading
65 syn keyword quake12Command pingservers playerlist players score
Bram Moolenaar071d4272004-06-13 20:20:40 +000066endif
67
68if exists("quake_is_quake2")
Bram Moolenaar42eeac32005-06-29 22:40:58 +000069 syn keyword quake2Command cmd demomap +use condump download drop gamemap
70 syn keyword quake2Command give gun_model setmaster sky sv_maplist wave
71 syn keyword quake2Command cmdlist gameversiona gun_next gun_prev invdrop
72 syn keyword quake2Command inven invnext invnextp invnextw invprev
73 syn keyword quake2Command invprevp invprevw invuse menu_addressbook
74 syn keyword quake2Command menu_credits menu_dmoptions menu_game
75 syn keyword quake2Command menu_joinserver menu_keys menu_loadgame
76 syn keyword quake2Command menu_main menu_multiplayer menu_options
77 syn keyword quake2Command menu_playerconfig menu_quit menu_savegame
78 syn keyword quake2Command menu_startserver menu_video
79 syn keyword quake2Command notarget precache prog togglechat vid_front
80 syn keyword quake2Command weaplast
Bram Moolenaar071d4272004-06-13 20:20:40 +000081endif
82
83syn case match
84
Bram Moolenaar42eeac32005-06-29 22:40:58 +000085if exists("quake_is_quake2") || exists("quake_is_quake3")
86 syn keyword quake23Command imagelist modellist path z_stats
Bram Moolenaar071d4272004-06-13 20:20:40 +000087endif
88
Bram Moolenaar42eeac32005-06-29 22:40:58 +000089if exists("quake_is_quake3")
90 syn keyword quake3Command +info +scores +zoom addbot arena banClient
91 syn keyword quake3Command banUser callteamvote callvote changeVectors
92 syn keyword quake3Command cinematic clientinfo clientkick cmd cmdlist
93 syn keyword quake3Command condump configstrings crash cvar_restart devmap
94 syn keyword quake3Command fdir follow freeze fs_openedList Fs_pureList
95 syn keyword quake3Command Fs_referencedList gfxinfo globalservers
96 syn keyword quake3Command hunk_stats in_restart -info levelshot
97 syn keyword quake3Command loaddeferred localservers map_restart mem_info
98 syn keyword quake3Command messagemode3 messagemode4 midiinfo model music
99 syn keyword quake3Command modelist net_restart nextframe nextskin noclip
100 syn keyword quake3Command notarget ping prevframe prevskin reset restart
101 syn keyword quake3Command s_disable_a3d s_enable_a3d s_info s_list s_stop
102 syn keyword quake3Command scanservers -scores screenshotJPEG sectorlist
103 syn keyword quake3Command serverstatus seta setenv sets setu setviewpos
104 syn keyword quake3Command shaderlist showip skinlist spdevmap startOribt
105 syn keyword quake3Command stats stopdemo stoprecord systeminfo togglemenu
106 syn keyword quake3Command tcmd team teamtask teamvote tell tell_attacker
107 syn keyword quake3Command tell_target testgun testmodel testshader toggle
108 syn keyword quake3Command touchFile vminfo vmprofile vmtest vosay
109 syn keyword quake3Command vosay_team vote votell vsay vsay_team vstr
110 syn keyword quake3Command vtaunt vtell vtell_attacker vtell_target weapon
111 syn keyword quake3Command writeconfig -zoom
112 syn match quake3Command display "\<[+-]button\(\d\|1[0-4]\)\>"
113endif
114
115hi def link quakeComment Comment
116hi def link quakeTodo Todo
117hi def link quakeString String
118hi def link quakeNumber Number
119hi def link quakeOctal Number
120hi def link quakeOctalZero PreProc
121hi def link quakeFloat Number
122hi def link quakeOctalError Error
123hi def link quakeCommand quakeCommands
124hi def link quake1Command quakeCommands
125hi def link quake12Command quakeCommands
126hi def link quake2Command quakeCommands
127hi def link quake23Command quakeCommands
128hi def link quake3Command quakeCommands
129hi def link quakeCommands Keyword
130
131let b:current_syntax = "quake"
132
133let &cpo = s:cpo_save
134unlet s:cpo_save