A lightweight and efficient Visual Studio Code extension that enables toggling read-only mode for any file using a keyboard shortcut, context menu, or Command Palette. Protect your files from accidental edits with clear visual indicators and persistent state across sessions.
CodeFreeze-Demo.mp4
- Toggle Read-Only Mode: Use
Ctrl+Alt+F(Windows/Linux) orCmd+Alt+F(macOS) to lock/unlock files - Visual Indicators: Prominent status bar indicators show when a file is locked
- Command Palette Integration: Access via
Ctrl+Shift+Pand search for "CodeFreeze: Toggle Read-Only Mode" - Context Menu Support: Right-click a file to toggle read-only mode
- Persistent State: Read-only status persists across editor sessions
- Status Bar Indicator: Displays the current mode (Read-Only /Editable)
- Open VS Code
- Go to the Extensions view (
Ctrl+Shift+XorCmd+Shift+X) - Search for "CodeFreeze"
- Click Install to add the extension
- Reload VS Code if prompted
Alternatively, install via the VS Code Marketplace or by running:
code --install-extension CodeFreeze
Open any file in VS Code. Toggle CodeFreeze:Read Only mode using one of these methods:
- Keyboard Shortcut: Press
Ctrl+Alt+F(Windows/Linux) orCmd+Alt+F(macOS) - Command Palette: Press
Ctrl+Shift+P, then typeToggle Read-Only Mode - Context Menu: Right-click the file in the editor and select
Toggle Read-Only Mode
When locked, the file cannot be edited or saved, and a status bar indicator confirms the mode.
This extension contributes the following settings:
CodeFreeze.toggle: Command to toggle CodeFreeze for the active file
You can customize the keyboard shortcut in VS Code's Keyboard Shortcuts settings.
No known issues at this time.
- Initial release of the CodeFreeze extension
- Features include keyboard shortcut, Command Palette, context menu, and status bar integration
- Read-only mode edit bug fixed
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch
- Submit a pull request
Built with ❤️ for the VS Code community.