Skip to content

Instantly share code, notes, and snippets.

@hkva
Created July 6, 2022 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkva/8fa15a6aac139a3b73f7e74d92c6912d to your computer and use it in GitHub Desktop.
Save hkva/8fa15a6aac139a3b73f7e74d92c6912d to your computer and use it in GitHub Desktop.
MvM popfile syntax highlighting for Sublime Text
%YAML 1.2
---
# See http://www.sublimetext.com/docs/syntax.html
file_extensions:
- pop
scope: source.example-c
contexts:
main:
# Strings
- match: '"'
push: string
# Numbers
- match: '\b(-)?[0-9.]+\b'
scope: constant.numeric.example-c
# Comments
# KeyValues treats anything after a '/' as a comment, but most people just use
# line comments
- match: '//'
scope: punctuation.definition.comment.example-c
push: comment
# Fake preprocessor directives
- match: '#base|#include'
scope: keyword.control.include
# Keywords: https://gist.github.com/sigsegv-mvm/be4697e3d352fbe5afcc08067beb27a9
# True/False
- match: '(?i)\b(yes|no)\b'
scope: keyword.operator.word
# Top-level
- match: 'WaveSchedule'
scope: keyword.operator.word
# WaveSchedule
- match: '\b(Templates|RandomPlacement|PeriodicSpawn|Wave|Mission|StartingCurrency|RespawnWaveTime|EventPopfile|FixedRespawnWaveTime|AddSentryBusterWhenDamageDealtExceeds|AddSentryBusterWhenKillCountExceeds|CanBotsAttackWhileInSpawnRoom|Advanced|IsEndless)\b'
scope: keyword.operator.word
# RandomPlacement
- match: '\b(Count|MinimumSeparation|NavAreaFilter|TFBot|Tank|SentryGun|Squad|Mob|RandomChoice)\b'
scope: keyword.operator.word
# PeriodicSpawn
- match: '\b(Where|ClosestPoint|When|TFBot|Tank|SentryGun|Squad|Mob|RandomChoice)\b'
scope: keyword.operator.word
# PeriodicSpawn values
- match: '\b(MinInterval|MaxInterval)\b'
scope: keyword.operator.word
# Wave
- match: '\b(WaveSpawn|Sound|Description|WaitWhenDone|Checkpoint|StartWaveOutput|DoneOutput|InitWaveOutput)\b'
scope: keyword.operator.word
# Wave sub-keys
- match: '\b(Target|Action)\b'
scope: keyword.operator.word
# Mission
- match: '\b(Where|ClosestPoint|Objective|InitialCooldown|CooldownTime|BeginAtWave|RunForThisManyWaves|DesiredCount|TFBot|Tank|SentryGun|Squad|Mob|RandomChoice)\b'
scope: keyword.operator.word
# WaveSpawn
- match: '\b(Template|Where|ClosestPoint|TotalCount|MaxActive|SpawnCount|WaitBeforeStarting|WaitBetweenSpawns|WaitBetweenSpawnsAfterDeath|StartWaveWarningSound|StartWaveOutput|FirstSpawnWarningSound|FirstSpawnOutput|LastSpawnWarningSound|LastSpawnOutput|DoneWarningSound|DoneOutput|TotalCurrency|Name|WaitForAllSpawned|WaitForAllDead|Support|RandomSpawn|TFBot|Tank|SentryGun|Squad|Mob|RandomChoice)\b'
scope: keyword.operator.word
# TFBot
- match: '\b(Template|Class|ClassIcon|Health|Scale|TeleportWhere|AutoJumpMin|AutoJumpMax|EventChangeAttributes|Skill|WeaponRestrictions|BehaviorModifiers|MaxVisionRange|Item|ItemAttributes|CharacterAttributes)\b'
scope: keyword.operator.word
# Tank
- match: '\b(Health|Speed|Name|Skin|StartingPathTrackNode|OnKilledOutput|OnBombDroppedOutput)\b'
scope: keyword.operator.word
# SentryGun
- match: '\b(Level)\b'
scope: keyword.operator.word
# Squad
- match: '\b(FormationSize|ShouldPreserveSquad|TFBot|Tank|SentryGun|Squad|Mob|RandomChoice)\b'
scope: keyword.operator.word
# Mob
- match: '\b(Count|TFBot|Tank|SentryGun|Squad|Mob|RandomChoice)\b'
scope: keyword.operator.word
# RandomChoice
- match: '\b(TFBot|Tank|SentryGun|Squad|Mob|RandomChoice)\b'
scope: keyword.operator.word
# Line comments
comment:
- meta_scope: comment.line.example-c
- match: $
pop: true
# C-style strings
string:
- meta_scope: string.quoted.double.c
- match: \\.
scope: constant.character.escape.c
- match: '"'
pop: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment