A powerful VS Code extension that allows you to save, restore, and sync your editor layouts across workspaces and devices.
Features
Save Current Layout: Capture your current VS Code layout including panel positions, sidebar visibility, and more
Restore Layouts: Quickly switch between saved layouts with a simple command
Default Layout: Set a default layout that automatically applies to new windows
Export/Import: Share layouts between devices by exporting and importing layout configurations
Auto-Apply: Automatically apply your default layout when opening new workspaces
Layout Elements Captured
Panel position (bottom/right)
Sidebar position (left/right)
Activity bar visibility
Status bar visibility
Sidebar visibility
Panel visibility
Zen mode state
Basic editor group layout
Commands
Layout Slaps: Save Current Layout - Save your current layout with a custom name
Layout Slaps: Restore Layout - Restore a previously saved layout
Layout Slaps: Manage Layouts - View, delete, or set default layouts
Layout Slaps: Set as Default Layout - Set a layout as the default for new windows
Layout Slaps: Export Layouts - Export all layouts to a JSON file
Layout Slaps: Import Layouts - Import layouts from a JSON file
Settings
layoutSlaps.autoApplyDefault: Automatically apply the default layout to new windows (default: true)
Usage
Save a Layout:
Arrange your VS Code interface as desired
Run Layout Slaps: Save Current Layout
You'll be prompted to specify current UI states (due to VS Code API limitations)
Give your layout a descriptive name
Restore a Layout:
Run Layout Slaps: Restore Layout
Select from your saved layouts
The layout will be applied automatically (no prompts needed)
Set Default Layout:
Run Layout Slaps: Set as Default Layout
Choose which layout should be applied to new windows
The setting layoutSlaps.autoApplyDefault is enabled by default
Sync Across Devices:
Export layouts: Layout Slaps: Export Layouts
Transfer the JSON file to another device
Import layouts: Layout Slaps: Import Layouts
Installation
From Source
Clone or download this extension
Install dependencies: npm install
Compile: npm run compile
Install in VS Code using the Extensions view
Development
Open the extension folder in VS Code
Press F5 to run in Extension Development Host
Test the commands in the new window
Limitations
VS Code API Limitations
UI Element Visibility Detection: VS Code only provides toggle commands for UI elements (activity bar, status bar, sidebar, panel), not direct visibility state detection. When saving a layout, you'll be prompted to specify the current visibility state of these elements.
Panel Position Detection: Due to VS Code API changes in v1.64, the extension cannot automatically detect your current panel position. You'll be prompted to specify the current panel position.
Zen Mode Detection: VS Code API doesn't expose current Zen Mode state (GitHub issue #89278). You'll be prompted to specify if Zen Mode is currently enabled.
Editor Group Orientation: While the extension can detect the number of editor groups, it cannot detect their orientation (horizontal/vertical split). You'll be prompted for this information when multiple groups exist.
Deprecated Commands: The extension uses newer panel positioning commands (workbench.action.positionPanelLeft/Right/Bottom) instead of the deprecated workbench.action.togglePanelPosition.
Side Panel vs Panel: VS Code now distinguishes between the Panel (bottom area) and Side Panel (left/right areas). The extension handles basic positioning but complex side panel configurations may have limited support.
Other Limitations
Editor group layouts are captured in basic form
View states within sidebars/panels have limited support
Some advanced workbench configurations may not be fully restored due to API restrictions
Contributing
Feel free to contribute improvements, bug fixes, or additional features!