xref: /vim-8.2.3635/runtime/syntax/quake.vim (revision 19a09a18)
1" Vim syntax file
2" Language:	    Quake[1-3] Configuration File
3" Maintainer:	    Nikolai Weibull <[email protected]>
4" URL:		    http://www.pcppopper.org/vim/syntax/pcp/quake/
5" Latest Revision:  2004-05-22
6" arch-tag:	    a95793d7-cab3-4544-a78c-1cea47b5870b
7" Variables: 	quake_is_quake1 - the syntax is to be used for quake1 configs
8" 		quake_is_quake2 - the syntax is to be used for quake2 configs
9" 		quake_is_quake3 - the syntax is to be used for quake3 configs
10
11
12if version < 600
13  syntax clear
14elseif exists("b:current_syntax")
15  finish
16endif
17
18
19" Set iskeyword since we need `-' (and potentially others) in keywords.
20" For version 5.x: Set it globally
21" For version 6.x: Set it locally
22if version >= 600
23  command -nargs=1 SetIsk setlocal iskeyword=<args>
24else
25  command -nargs=1 SetIsk set iskeyword=<args>
26endif
27SetIsk 48-57,65-90,97-122,+,-,_
28delcommand SetIsk
29
30
31" comments
32syn region	quakeComment	display oneline start="//" end="$" end=";" keepend contains=quakeTodo
33
34" todo
35syn keyword	quakeTodo	contained TODO FIXME XXX NOTE
36
37" string (can contain numbers (which should be hilighted as such)
38syn region	quakeString	display oneline start=+"+ skip=+\\"+ end=+"\|$+ contains=quakeNumbers,@quakeCommands
39
40" number
41syn case ignore
42syn match	quakeNumbers	display transparent "\<\d\|\.\d" contains=quakeNumber,quakeFloat,quakeOctalError,quakeOctal
43syn match	quakeNumber	display contained "\d\+\>"
44" Flag the first zero of an octal number as something special
45syn match	quakeOctal	display contained "0\o\+\>" contains=quakeOctalZero
46syn match	quakeOctalZero	display contained "\<0"
47" floating point number, with dot
48syn match	quakeFloat	display contained "\d\+\.\d*"
49" floating point number, starting with a dot
50syn match	quakeFloat	display contained "\.\d\+\>"
51" flag an octal number with wrong digits
52syn match	quakeOctalError	display contained "0\o*[89]\d*"
53syn case match
54
55" commands
56syn case ignore
57syn cluster	quakeCommands	contains=quakeCommand,quake1Command,quake12Command,Quake2Command,Quake23Command,Quake3Command
58
59syn keyword	quakeCommand	+attack +back +forward +left +lookdown +lookup
60syn keyword	quakeCommand	+mlook +movedown +moveleft +moveright +moveup
61syn keyword	quakeCommand	+right +speed +strafe -attack -back bind
62syn keyword	quakeCommand	bindlist centerview clear connect cvarlist dir
63syn keyword	quakeCommand	disconnect dumpuser echo error exec -forward
64syn keyword	quakeCommand	god heartbeat joy_advancedupdate kick kill
65syn keyword	quakeCommand	killserver -left -lookdown -lookup map
66syn keyword	quakeCommand	messagemode messagemode2 -mlook modellist
67syn keyword	quakeCommand	-movedown -moveleft -moveright -moveup play
68syn keyword	quakeCommand	quit rcon reconnect record -right say say_team
69syn keyword	quakeCommand	screenshot serverinfo serverrecord serverstop
70syn keyword	quakeCommand	set sizedown sizeup snd_restart soundinfo
71syn keyword	quakeCommand	soundlist -speed spmap status -strafe stopsound
72syn keyword	quakeCommand	toggleconsole unbind unbindall userinfo pause
73syn keyword	quakeCommand	vid_restart viewpos wait weapnext weapprev
74
75if exists("quake_is_quake1")
76syn keyword	quake1Command	sv
77endif
78
79if exists("quake_is_quake1") || exists("quake_is_quake2")
80syn keyword	quake12Command	+klook alias cd impulse link load save
81syn keyword	quake12Command	timerefresh changing info loading
82syn keyword	quake12Command	pingservers playerlist players score
83endif
84
85if exists("quake_is_quake2")
86syn keyword	quake2Command	cmd demomap +use condump download drop gamemap
87syn keyword	quake2Command	give gun_model setmaster sky sv_maplist wave
88syn keyword	quake2Command	cmdlist gameversiona gun_next gun_prev invdrop
89syn keyword	quake2Command	inven invnext invnextp invnextw invprev
90syn keyword	quake2Command	invprevp invprevw invuse menu_addressbook
91syn keyword	quake2Command	menu_credits menu_dmoptions menu_game
92syn keyword	quake2Command	menu_joinserver menu_keys menu_loadgame
93syn keyword	quake2Command	menu_main menu_multiplayer menu_options
94syn keyword	quake2Command	menu_playerconfig menu_quit menu_savegame
95syn keyword	quake2Command	menu_startserver menu_video
96syn keyword	quake2Command	notarget precache prog togglechat vid_front
97syn keyword	quake2Command	weaplast
98endif
99
100if exists("quake_is_quake2") || exists("quake_is_quake3")
101syn keyword	quake23Command	imagelist modellist path z_stats
102endif
103
104if exists("quake_is_quake3")
105syn keyword	quake3Command	+info +scores +zoom addbot arena banClient
106syn keyword	quake3Command	banUser callteamvote callvote changeVectors
107syn keyword	quake3Command	cinematic clientinfo clientkick cmd cmdlist
108syn keyword	quake3Command	condump configstrings crash cvar_restart devmap
109syn keyword	quake3Command	fdir follow freeze fs_openedList Fs_pureList
110syn keyword	quake3Command	Fs_referencedList gfxinfo globalservers
111syn keyword	quake3Command	hunk_stats in_restart -info levelshot
112syn keyword	quake3Command	loaddeferred localservers map_restart mem_info
113syn keyword	quake3Command	messagemode3 messagemode4 midiinfo model music
114syn keyword	quake3Command	modelist net_restart nextframe nextskin noclip
115syn keyword	quake3Command	notarget ping prevframe prevskin reset restart
116syn keyword	quake3Command	s_disable_a3d s_enable_a3d s_info s_list s_stop
117syn keyword	quake3Command	scanservers -scores screenshotJPEG sectorlist
118syn keyword	quake3Command	serverstatus seta setenv sets setu setviewpos
119syn keyword	quake3Command	shaderlist showip skinlist spdevmap startOribt
120syn keyword	quake3Command	stats stopdemo stoprecord systeminfo togglemenu
121syn keyword	quake3Command	tcmd team teamtask teamvote tell tell_attacker
122syn keyword	quake3Command	tell_target testgun testmodel testshader toggle
123syn keyword	quake3Command	touchFile vminfo vmprofile vmtest vosay
124syn keyword	quake3Command	vosay_team vote votell vsay vsay_team vstr
125syn keyword	quake3Command	vtaunt vtell vtell_attacker vtell_target weapon
126syn keyword	quake3Command	writeconfig -zoom
127syn match	quake3Command	display "\<[+-]button\(\d\|1[0-4]\)\>"
128endif
129
130syn case match
131
132" Define the default highlighting.
133" For version 5.7 and earlier: only when not done already
134" For version 5.8 and later: only when an item doesn't have highlighting yet
135if version >= 508 || !exists("did_screen_syn_inits")
136  if version < 508
137    let did_screen_syn_inits = 1
138    command -nargs=+ HiLink hi link <args>
139  else
140    command -nargs=+ HiLink hi def link <args>
141  endif
142
143  HiLink quakeComment 	Comment
144  HiLink quakeTodo 	Todo
145  HiLink quakeString 	String
146  HiLink quakeNumber	Number
147  HiLink quakeOctal	Number
148  HiLink quakeOctalZero	Number
149  HiLink quakeFloat	Number
150  HiLink quakeOctalError	Error
151  HiLink quakeCommand	quakeCommands
152  HiLink quake1Command	quakeCommands
153  HiLink quake12Command	quakeCommands
154  HiLink quake2Command	quakeCommands
155  HiLink quake23Command	quakeCommands
156  HiLink quake3Command	quakeCommands
157  HiLink quakeCommands	Keyword
158
159  delcommand HiLink
160endif
161
162" vim: set sts=2 sw=2:
163