TF2 cfg syntax highlighting
Adds syntax highlighting support for .cfg files
Features
Example config
 |
 |
| Plain Text |
Using the Monokai Pro theme |
Used grammar
string.quoted.double.cfg
Used in say, echo & exec.
variable.other.readwrite.cfg
Normal text, alias commands, unrecognized commands.
constant
.numeric
ConVar constants, numbers.
.other.key
MOUSE1, SPACE, F3
-
Comments
support
.function
.cfg.toggle
Action commands: +attack2, -jump, +use_action_slot_item.
.cfg.argument
Argument action commands: wait 3, taunt_by_name Taunt: Schaudenfreunde, addcond 91.
.cfg.trigger
Trigger action commands: kill, mp_forcewin, voice_menu1.
.variable
.cfg
Console commands: mat_picmip, sv_cheats, sensitivity.
.cfg.addon
Addon commands: prec_mode.
invalid.deprecated.cfg
Deprecated commands and actions: g_ragdoll_fadespeed, god, mat_parallaxmap.
Install
- Download VS Code
-
Install the extension
-
Press reload
Setup
- Open a
.cfg file
- Click at the bottom right to change its "File Association" (Or press
Ctrl+K, Ctrl+M)
- Select,
Configure File Association for '.cfg'...
- Select
TF2 cfg from the list
Alternatively...
You can open your user settings (Ctrl+,) and add
"files.associations": {
"*.cfg": "TF2 cfg"
}
Theme
Note that you can change/control the Color Theme:
Known Issues
- My regex has not been reviewed and there's potentially a smarter way to be doing some of the things
- Ideally there'd be a custom color theme with property scope names (currently I'm using at least one
.js name)
Release Notes
v0.0.8
- Improved regular expression.
- Added matches for all Team Fortress 2 commands.
- Improved syntax highlighting for strings and command chains.
- Shortened regex.
- Improved syntax highlighting for themes.
v0.0.7
- Renamed the settings rule to commands.
- Fixed bind and unbind key regular expression.
- Added regular expression for
set* commands.
- Created a pattern for echo strings
- Fixed partial variable rule matches inside strings.
- Added several more matches for TF2, P-REC, and HLAE commands.
v0.0.6
- Improved regular expression
Unlicense
This is free is all senses of the word. UNLICENSE
| |