xref: /vim-8.2.3635/runtime/syntax/quake.vim (revision 0fa313a7)
1" Vim syntax file
2" Language:         Quake[1-3] configuration file
3" Maintainer:       Nikolai Weibull <[email protected]>
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
7
8if exists("b:current_syntax")
9  finish
10endif
11
12let s:cpo_save = &cpo
13set cpo&vim
14
15setlocal iskeyword=@,48-57,+,-,_
16
17syn keyword quakeTodo         contained TODO FIXME XXX NOTE
18
19syn region  quakeComment      display oneline start='//' end='$' end=';'
20                              \ keepend contains=quakeTodo,@Spell
21
22syn region  quakeString       display oneline start=+"+ skip=+\\\\\|\\"+
23                              \ end=+"\|$+ contains=quakeNumbers,@quakeCommands
24
25syn case ignore
26
27syn 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*'
37
38syn 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
57
58if exists("quake_is_quake1")
59  syn keyword quake1Command   sv
60endif
61
62if exists("quake_is_quake1") || exists("quake_is_quake2")
63  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
66endif
67
68if exists("quake_is_quake2")
69  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
81endif
82
83syn case match
84
85if exists("quake_is_quake2") || exists("quake_is_quake3")
86  syn keyword quake23Command  imagelist modellist path z_stats
87endif
88
89if 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
135