Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Env PreviewNew to Visual Studio Code? Get it now.
Env Preview

Env Preview

simonhe

|
71 installs
| (1) | Free
| Sponsor
Instantly preview .env file variable values on hover in VS Code. Supports multiple .env files and provides quick edit/copy actions.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Env Preview Logo

Env Preview for VS Code

VS Code Marketplace Version VS Code Marketplace Downloads License

English | 简体中文

Tired of switching between different .env files to check variable values? This plugin lets you effortlessly preview environment variable values directly within your VS Code editor. Hover over an environment variable in your code to see its value from different .env files.

✨ Features

  • ⚡️ Instant Preview: Hover over an environment variable (e.g., process.env.API_KEY or import.meta.env.VITE_USER) to instantly see its value.
  • 📄 Multi-File Support: Displays values from various .env files (e.g., .env, .env.development, .env.production) simultaneously.
  • 🚀 Quick Actions:
    • Edit: Directly jump to the variable definition in the corresponding .env file.
    • Copy: Quickly copy the variable's value.
  • 🏷️ Clear Identification: Easily distinguish between different environment configurations (e.g., development, staging, production).

🚀 Installation

  1. Open Visual Studio Code.
  2. Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
  3. Search for Env Preview.
  4. Click Install.

Or, install via the VS Code Marketplace.

💡 Usage

Once installed, simply open a project with .env files and hover your mouse cursor over an environment variable in your code. A tooltip will appear showing the values from your configured .env files.

⚙️ Behavior & Configuration

  • Matching strategy: by default the extension follows a "last wins" strategy when the same key appears multiple times in a single .env file (later declarations override earlier ones). The internal helper also supports a first strategy for callers that need the first occurrence.
  • Debounce / batching: file watch events are debounced (250–300ms) and processed in batches to avoid heavy I/O when many file events occur in rapid succession (for example during git operations or bulk saves).
  • Security: hover values are displayed inside code blocks and can be masked; copy actions still provide the raw value for convenience. Values are escaped to avoid markdown codeblock injection.

🙏 Sponsors

You can also buy me a cup of coffee.

📄 License

MIT © Simon He

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