Skip to content
| Marketplace
Sign in
Visual Studio Code>Keymaps>Editor ContextNew to Visual Studio Code? Get it now.
Editor Context

Editor Context

Nazmus Sayad

|
2 installs
| (0) | Free
A VS Code extension that automatically detects your IDE environment and exposes it as context variables for cross-editor compatible configurations and keybindings.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Editor Context

A VS Code extension that automatically detects and exposes your IDE environment information as context variables. Perfect for creating cross-editor compatible extensions and configurations.

Features

  • Automatic IDE Detection: Identifies which VS Code-based editor you're using (VSCode, Cursor, Windsurf, VSCodium, Trae, Kiro, Antigravity, and more)
  • Version Detection: Provides IDE version information for version-specific configurations
  • URI Scheme Support: Exposes the IDE's URI scheme for deep linking and protocol handling
  • Context Variables: Sets editor context variables that can be used in:
    • Keybindings (when clauses)
    • Settings configurations
    • Extension conditions
    • Custom commands

Supported IDEs (Actually any VS Code based IDE should work)

  • Visual Studio Code
  • Visual Studio Code - Insiders
  • VSCodium
  • Cursor
  • Windsurf
  • Antigravity
  • Trae
  • Kiro

Usage

Once installed, the extension automatically sets context variables based on your detected IDE:

  • editor.app - The full application name
  • editor.uri - The URI scheme used by the IDE
  • editor.version - The IDE version number (e.g., 1.60)
  • editor.${key} - Set to true for the specific IDE (e.g., editor.cursor, editor.windsurf)
  • editor.unsupported - Set to true if the IDE is not recognized
image

Example: Conditional Keybindings

{
  "key": "ctrl+shift+p",
  "command": "cursor.command",
  "when": "editor.cursor"
}

Example: Settings per IDE

{
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "when": "editor.vscode"
  }
}

Docs

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft