Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Surge SyntaxNew to Visual Studio Code? Get it now.
Surge Syntax

Surge Syntax

Cyrus

| (0) | Free
Syntax highlighting, formatting, auto-completion and hover documentation for Surge configuration files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Surge Syntax

VSCode extension for Surge network proxy configuration files.

Features

  • Syntax Highlighting — 19 grammar patterns covering all Surge section types, rule keywords, proxy protocols, directives, and more
  • Formatting — Normalize = spacing, comma spacing, and blank lines with Format Document / Format Selection
  • Auto-completion — Context-aware suggestions for section names, rule types, policies, protocols, group types, directives, and General keys
  • Hover Documentation — Inline documentation for rule types, built-in policies, protocols, group types, and section headers

Supported File Types

Type Detection
.sgmodule Auto-detected by extension
#!MANAGED-CONFIG Auto-detected by first line (managed configs)
#!SURGE Auto-detected by first line (add this to any Surge config)

For .conf or other generic extensions, either add #!SURGE as the first line, or configure VS Code manually:

"files.associations": {
  "*.conf": "surge"
}

Formatting Rules

  • Normalize key = value spacing (single space around =)
  • Normalize comma spacing in proxy/group/script definitions
  • Collapse multiple blank lines between sections to one
  • Preserves: rule lines (no-space commas), rewrite/regex content, comments, directives

Links

  • Surge Official Documentation
  • Surge Knowledge Base
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft