ContextKeeper helps you save and restore your editor layout and open files in VS Code.
- Save current editor state as a named "Context".
- Restore contexts at any time.
- Manage contexts via a dedicated Side Bar view.
- Supports multiple tab groups and splits.
- Split Layouts: While the extension restores files into their respective groups, the exact "grid" layout (e.g. horizontal vs vertical split direction) is determined by VS Code's default behavior during restoration and may not perfectly match the saved state.
- Cursor Position: Cursor position and active selection are restored for the active file in each group.
Contexts are stored in VS Code's Extension Global State.
- This is a persistent storage area managed by VS Code (typically a localized SQLite/JSON DB in your user data directory).
- Contexts persist across VS Code updates and system reboots.
- They are not checked into your project's git repository.
- From Source:
- Clone repo, run
npm install, thennpm run compile. - Package into VSIX:
npx @vscode/vsce package. - Install in VS Code:
Extensions View->...->Install from VSIX....
- Clone repo, run
- Repository: https://github.com/MuzafarJatoi/context-keeper
- Issues/Bugs: https://github.com/MuzafarJatoi/context-keeper/issues
- Save Context:
- Open
ContextKeeperin the Activity Bar (Sidebar). - Click the Save Context icon (or run command
ContextKeeper: Save Context). - Give it a name. It is now saved.
- Open
- Restore Context:
- Click on any context in the Sidebar list.
- Note: This effectively closes current tabs and re-opens the saved layout.
- Manage:
- Rename: Click the
pencilicon on a context item. - Delete: Click the
trashicon on a context item.
- Rename: Click the
To set up this extension for development:
-
Clone the repository.
-
Install dependencies:
npm install
-
Compile:
npm run compile
-
Run: Open the project in VS Code and press
F5(or run "Debug: Start Debugging"). This will open a new Extension Development Host window with the extension loaded. -
Test:
npm test
This project is licensed under the MIT License - see the LICENSE file for details.