Skip to content

pedoc/switch-environments

 
 

Repository files navigation

switch-environments

Build Version Downloads

A powerful IntelliJ IDEA plugin for managing environment variables with group support and beautiful UI.

Features

  • 🗂️ Group Management: Organize environment variables into logical groups
  • Group Activation Control: Enable/disable entire groups
  • 📥 Multi-format Import: Import variables from .env, .properties, and .txt files
  • 🎨 Clean UI: Modern list and table interface
  • 💾 Persistent Storage: All settings are saved automatically
  • 🔧 Easy Management: Add, edit, and delete variables with simple dialogs
  • 🌍 Global View: Special first group shows all active variables

Installation

  • Using the IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "SwitchEnvironments" > Install

  • Using JetBrains Marketplace:

    Go to JetBrains Marketplace and install it by clicking the Install to ... button in case your IDE is running.

    You can also download the latest release from JetBrains Marketplace and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

Usage

Accessing the Plugin

  • Tool Window: View → Tool Windows → Environment Variables
  • Menu: Tools → Environment Variables → Open Environment Manager

Managing Groups

  1. Add Group: Click the "+" button in the group toolbar
  2. Edit Group: Select a group and click the edit button
  3. Delete Group: Select a group and click the "-" button
  4. Activate/Deactivate: Use checkboxes in settings or edit group dialog
  5. Import/Export: Click the "⚙️" button in the group toolbar
  6. Sort: Long-press and drag with the left mouse button to move it

Built-in Groups

  • Env:Read-only view of all active variables from enabled groups

Managing Variables

  1. Add Variable: Select a group (not built-in groups), then click "+" in the variables toolbar
  2. Edit Variable: Double-click a variable or select and click edit button
  3. Delete Variable: Select a variable and click "-" button
  4. Variables are automatically active when their group is active
  5. Import: Select a group (not built-in groups), then click "Import File" button

Import Support

Import Config

The plugin supports exporting all data as well as importing that data.

Import Variables

The plugin supports multiple file formats:

  • .env files: Standard environment file format
  • .properties files: Java properties format with escape sequence support
  • .txt files: Simple key=value format
Supported File Formats
  • .env files:
# This is a comment
DATABASE_URL=postgresql://localhost:5432/mydb
API_KEY=your_secret_key_here
DEBUG=true
APP_NAME="My Application"
  • .properties files:
# Properties format
database.url=postgresql://localhost:5432/mydb
api.key=your_secret_key_here
debug=true
app.name=My Application
  • .txt files:
DATABASE_URL=postgresql://localhost:5432/mydb
API_KEY# Environment Variables Manager Plugin

A powerful IntelliJ IDEA plugin for managing environment variables with group support and beautiful UI.

## Features

- 🗂️ **Group Management**: Organize environment variables into logical groups
- ✅ **Activation Control**: Enable/disable entire groups or individual variables
- 📥 **Import Support**: Import variables from `.env` files
- 📤 **Export Support**: Export variables to `.env` files
- 🎨 **Beautiful UI**: Modern and intuitive user interface
- 💾 **Persistent Storage**: All settings are saved automatically
- 🔧 **Easy Management**: Add, edit, and delete variables with simple dialogs

## Installation

1. Clone this repository
2. Open the project in IntelliJ IDEA
3. Run `./gradlew buildPlugin` to build the plugin
4. Install the generated plugin file from `build/distributions/`

Or build and run directly:
```bash
./gradlew runIde

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

Apache 2.0 License

Donation

If you like this plugin, you can buy me a cup of coffee. Thank you!

About

更换环境变量

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%